Skip to content

entity

get_index

get_index() -> number

Returns the index of the entity.

Usage

local ent = entities[1];
ent:get_index(); -- returns 1

is_player

is_player() -> bool

Returns true if the entity is a player.

Usage

if ent:is_player() then
    -- do stuff
end

is_valid

is_valid() -> bool

Returns true if the entity is a player and alive.

Usage

if ent:is_valid() then
    -- do stuff
end

is_enemy

is_enemy() -> bool

Returns true if the entity is an enemy player.

Usage

if ent:is_enemy() then
    -- do stuff
end

is_dormant

is_dormant() -> bool

Returns true if the entity is dormant.

Usage

if ent:is_dormant() then
    -- do stuff
end

get_class

get_class() -> string

Returns the classname of the entity.

Usage

ent:get_class(); -- ex: CCSPlayer

get_prop

get_prop(name: string, index: number = 0) -> any

Deprecated

This function is deprecated and will be removed in future updates.

Returns the value of the prop.

Parameters

Name Type Description
name string Netvar name
index number Array index. Defaults to 0

Usage

ent:get_prop('m_hMyWeapons', 1);

set_prop

set_prop(name: string, index: number, value: any)

Deprecated

This function is deprecated and will be removed in future updates.

Sets the value of a prop.

Parameters

Name Type Description
name string Netvar name
index number Array index. Set to 0 if your prop is not an array
value any Value

Usage

ent:set_prop("m_bSpotted", 0, true);

get_player_info

get_player_info() -> player_info

Returns the player_info of a specified player

Usage

local player_info = ent:get_player_info();
print(player_info.steam_id);

get_hitbox_position

get_hitbox_position(hitbox: number) -> number, number, number

Returns the hitbox position of a player.

Parameters

Name Type Description
hitbox number Hitbox ID

Usage

local x, y, z = ent:get_hitbox_position(0);

get_eye_position

get_eye_position() -> number, number, number

Returns the eye position of a player.

Usage

local x, y, z = ent:get_eye_position();

get_move_type

get_move_type() -> number

Returns the move type of an entity.

Usage

local mt = ent:get_move_type();

get_esp_alpha

get_esp_alpha() -> number

Returns the esp alpha value of an entity. Bounds are 0 to 255

Usage

local alpha = ent:get_esp_alpha();