Lua · Variables · Game state

game

The match and a quick list of players.

Players come from the same data the ESP already reads, once a frame, so calling these often costs nothing extra. Only living players are listed. For bones, velocity and more, use entity.

FunctionWhat it does
game.local_player()You, as a player table. nil when you are dead or not in a match.
game.players()All living players, you included.
game.map()The map name, for example de_mirage. Empty until it is known.
game.mode()The game mode: Competitive, Premier, Casual, Wingman, Deathmatch, Arms Race, or Community - … on community servers. Empty until known.
game.in_match()True while you are in a match (not in the main menu or loading).
game.time()Seconds since the current round started. 0 until the first round start is seen.
game.round()The current round number, starting at 1.

#game.local_player

game.local_player()

You, as a player table. nil when you are dead or not in a match.

Returns

player | nil
See the player table below.
Example
local me = game.local_player()
if me then print(me.health, me.weapon) end

#game.players

game.players()

All living players, you included.

Returns

player[]
An array of player tables.
Example
for _, p in ipairs(game.players()) do
    if p.enemy then print(p.name, p.health) end
end

#game.map

game.map()

The map name, for example de_mirage. Empty until it is known.

Returns

string
Map name.

#game.mode

game.mode()

The game mode: Competitive, Premier, Casual, Wingman, Deathmatch, Arms Race, or Community - … on community servers. Empty until known.

Returns

string
Mode name.

#game.in_match

game.in_match()

True while you are in a match (not in the main menu or loading).

Returns

boolean
-

#game.time

game.time()

Seconds since the current round started. 0 until the first round start is seen.

Returns

number
Seconds.

#game.round

game.round()

The current round number, starting at 1.

Returns

integer
Round.

Player table

FieldTypeMeaning
slotintegerPlayer slot. Use it with entity.get and esp.add_text.
namestringNickname.
teaminteger2 = T, 3 = CT.
healthinteger1 to 100.
alivebooleanAlways true in these lists (only living players are listed).
enemybooleanOn the other team. With Deathmatch mode on in Misc, everyone but you.
is_localbooleanThis is you.
weaponstringHeld weapon without the prefix: ak47, awp, knife, hegrenade. NULL when nothing is held.
posvectorFeet position in game units.
headvectorAbout head height (pos + 64 units). entity.* gives the real head bone.
armorintegerArmour, 0 to 100. 0 until the scoreboard data arrives.
moneyintegerMoney. 0 until the scoreboard data arrives.
steamidstringSteamID64 as text. Empty until known; bots show 0.