xhookLua
Game

esp

Add your own text, flags and bars to the player ESP. They show under LUA in the ESP element list.

Functions

group:new_text

group:new_text(name [, preview], fn) -> element
NameTypeDescription
namestringChip label and save key.
previewoptionalstringSample on chip hover. Default name.
fnfunction(player)Returns text, or nil to hide.

Text on a side of the box; starts at the bottom.

  • fn may return a colour second ({r,g,b,a} or draw.color()); it beats the menu colour.
  • fn runs once per drawn player per frame, under the on_paint budget.

group:new_flag

group:new_flag(name [, preview], fn) -> element
NameTypeDescription
namestringChip label and save key.
previewoptionalstringSample on chip hover. Default name.
fnfunction(player)Returns text, or nil to hide.

Like new_text, but starts on the right with the built-in flags.

group:new_bar

group:new_bar(name, fn) -> element
NameTypeDescription
namestringChip label and save key.
fnfunction(player)Returns 0 to 1, or nil to hide.

Bar along a side of the box; starts on the left.

Bars stack outside health and armour.

element:get

element:get() -> boolean

Whether it's switched on.

element:set

element:set(on)
NameType
onboolean

Switches it on or off.

element:name

element:name() -> string

Its name.

element:position

element:position() -> string

"left", "right", "top" or "bottom".

element:set_position

element:set_position(side)
NameTypeDescription
sidestringleft, right, top or bottom.

Moves it to a side.

element:color

element:color() -> table

Menu colour as {r, g, b, a}.

element:set_color

element:set_color(color)
NameTypeDescription
colortable | integer{r,g,b,a} or draw.color()

Sets the menu colour.

element:create

element:create() -> ui.Card

Settings card in the element's right-click menu; same builders as tab:card().

element:remove

element:remove()

Takes it out of the ESP and the menu.

element:is_valid

element:is_valid() -> boolean

False after remove or a script reload.

Elements go away when their script reloads, is disabled or deleted.

Fields

Player groups

NameTypeDescription
esp.enemygroupEnemies, hostile NPCs included.
esp.teamgroupTeammates.
esp.local_playergroupYou, in thirdperson. Same as esp["local"].
esp.npcgroupFriendly NPCs.
esp ยท Lua API ยท xhook