Skip to content

entity

Represents in-game entity

Warning

Entities must be compared using index method! This comparison DOES NOT work: ent_1 == ent_2, but this DOES: ent_1:index() == ent_2:index()

Info

Prop list: here

Methods

index(): number

Returns the entity index which represents the entities position in the entity_list

1
local idx = ent:index()

is_valid(): bool

Returns if entity is alive and valid

1
2
if ent:is_valid() then
end

is_dormant(): bool

Returns if entity is in dormant state (data not sent by server)

1
2
if not ent:is_dormant() then
end

is_enemy(): bool

Returns if entity is enemy

1
2
if ent:is_enemy() then
end

get_abs_origin(): vec3

Returns absolute origin

1
local pos = ent:get_abs_origin()

get_player_info(): player_info

Returns player info (alias for engine_client.get_player_info)

1
local info = me:get_player_info()

get_class(): string

Returns classname of current entity

1
2
-- get all entities with same class
local all_same_ents = entity_list.get_all(ent:get_class())

get_prop_xxx(netvar, index): number/bool/string/vec3

Type Name Description Default
string netvar Netvar prop to get none
number index Array index (if netvar is an array) empty

Returns prop value. xxx stands for one of those:

Type Function name
bool get_prop_bool
number get_prop_float
vec3 get_prop_vec3
number get_prop_int
number get_prop_short
string get_prop_string
1
local hashelm = entity:get_prop_bool('m_bHasHelmet');

set_prop_xxx(netvar, index, value)

Type Name Description Default
string netvar Netvar prop to get none
number index Array index (if netvar is an array) empty
number/bool/vec3 value Value to set

Sets value to a prop. xxx stands for one of those:

Type Function name
bool set_prop_bool
number set_prop_float
vec3 set_prop_vec3
number set_prop_int
number set_prop_short
1
ent:set_prop_bool('m_bSpotted', true)

get_hitbox_position(hb): vec3

Type Name Description Default
number hb Hitbox ID none

Returns position of a hitbox. Hitbox list:

Name Number
head 0
neck 1
pelvis 2
spine_0 3
spine_1 4
spine_2 5
spine_3 6
leg_upper_L 7
leg_upper_R 8
leg_lower_L 9
leg_lower_R 10
ankle_L 11
ankle_R 12
hand_L 13
hand_R 14
arm_upper_L 15
arm_lower_L 16
arm_upper_R 17
arm_lower_R 18
1
local head = ent:get_hitbox_position(0)

get_eye_position(): vec3

Returns current entity's eye position

1
local eyes = me:get_eye_position()

get_bounding_box(): number, number, number, number

Returns mins, maxs of bounding box or -1, -1, -1, -1 on failure

1
local mins_x, mins_y, maxs_x, maxs_y = player:get_bounding_box()

get_icon_name(): string

Only for weapons. Returns icon used in ESP and deathnotices

1
local ico = my_ak:get_icon_name()