🙎Entities

entities namespace

Functions

get_entity

entities.get_entity(engine.get_local_player())

entity index

number

entity's server index

Returns:

entity's object

get_entity_from_handle

entities.get_entity_from_handle(local_player:get_prop("m_hMyWeapons", 1))

entity handle

number

a handle to the entity ex: m_hMyWeapons[1]

Returns:

entity's object

for_each

entities.for_each(function(entity)
    print(string.format("Entity's index: %i", entity:get_index()))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the entity.

Usage:

Runs for each entity on the server.

for_each_z

entities.for_each_z(function(entity)
    print(string.format("Entity's index: %i", entity:get_index()))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the entity.

Usage:

Runs for each entity on the server starting from the end.

for_each_player

entities.for_each_player(function(player)
    print(string.format("Player: %i has %i health", 
    player:get_index(), 
    player:get_prop("m_iHealth")))
end)

function callback

function

A function to use as a callback.

Must have 1 argument for the player.

Usage:

Runs for each player on the server.

Last updated