Skip to content

Players, weapons and bombs

Array of player tables:

Field Type Description
index integer Entity index
handle / pawnHandle integer Full controller/pawn entity handles, including serial; compare these to detect recycled indices. 4294967295 means an invalid pawn handle
isLocalPlayer boolean Local client
isSynced boolean Local or network-synced peer (skin sync)
hasVisualData boolean Bones / visual data ready
duckAmount number 0..1 crouch
aimPunchPitch / aimPunchYaw number Accumulated aim punch (degrees)
money integer Cash (-1 if unknown)
isBombCarrier / isPlanting / isReloading boolean Flags
hasDefuser / isImmune / isVisible / behindSmoke boolean Flags
weapons {def,...} Held weapon item definition indices
activeWeapon integer Active weapon def index (0 if none)
name string Sanitized name
isBot boolean steamId == "0"
steamId string Exact decimal SteamID64 (never use number)
armor / ping integer
competitiveRank integer Skill group 0 or 1..18
alive boolean Pawn alive
health / team integer From pawn when valid (2 T / 3 CT)
origin {x,y,z} World position
hitboxes / bones {{x,y,z},...} Same table: world joint positions (CS2 set, up to 19); Lua index 1 ≈ head. Prefer bones for skeleton scripts
controller / pawn table Schema __index proxies
local account = p.controller and p.controller.m_iAccount
local flags = p.pawn and p.pawn.m_fFlags
-- uint64 schema fields (e.g. m_steamID) return DECIMAL strings
local sid = p.controller and p.controller.m_steamID -- same precision as p.steamId

Supported types: bool, floats, ints, Vector, QAngle, string pointers, int64/uint64 as decimal strings.

Local player table, or nil.

Array of entity indices currently in the skin-sync set (not including a separate local entry - use p.isSynced / isLocalPlayer on player tables).

Who is spectating the local player (snapshot). Each entry:

Field Type Notes
name string Spectator name
mode integer 2 in-eye, 3 chase, 4 roaming

Dropped world weapons:

Field Type
name string (display)
clip / reserve integer (-1 if N/A)
origin {x,y,z} when available

Copied details of the local active weapon, or nil without a live held weapon. Safe from on_draw; captures refresh each draw frame and before on_create_move. cmd.weapon contains the same details captured for that command callback.

Field Meaning
handle, index, definition, name Full handle, weapon entity index, item definition, copied designer name
clip, reserve_magazines Loaded ammo and spare magazines (not reserve rounds)
active, reloading, scoped, mode Current weapon state
recoil_index Native recoil counter
inaccuracy, spread, max_speed Native active-weapon values; absent when the corresponding binding is unavailable
next_primary_tick, next_primary_fraction, next_secondary_tick Native attack cooldown fields
postpone_fire_tick, next_attack_time Revolver/deploy timing; times use the game’s clock
can_primary_attack, can_secondary_attack Snapshot checks for active weapon, ammo, reload, deploy/cooldown and revolver postpone

Readiness is a snapshot check, not a guarantee of a shot. Native state and secondary behavior still depend on the weapon; scripts request input through command methods.

Copied local held inventory, using the fields above. Native spread/inaccuracy/max-speed values are populated for the active weapon. Pass an entry’s full handle to cmd:switch_weapon; an item definition or entity index is not a full handle.

Planted C4 (all GameTime fields use the same axis as aqua.get_curtime()):

Field Type Notes
origin {x,y,z} When scene node present
blowTime number Detonation GameTime
timerLength number Full fuse length (seconds)
defused / ticking boolean
site integer 0 = A, 1 = B
siteName string "A" / "B" / "?"
beingDefused boolean
defuseLength number Full defuse duration (seconds)
defuseCountDown number GameTime when defuse completes
hasExploded boolean
timeRemaining number blowTime - curtime (can be negative)
defuseRemaining number? Only when beingDefused; defuseCountDown - curtime
for _, b in ipairs(aqua.get_bombs()) do
if b.ticking and not b.defused then
print(b.siteName, string.format("%.1fs", b.timeRemaining or 0))
if b.beingDefused then
print(" defuse", b.defuseRemaining)
end
end
end

Live grenades in flight (snapshot):

Field Type Notes
type string "smokegrenade", "flashbang", "hegrenade", "molotov", "incgrenade" or "decoy" (match the panorama icon names)
handle integer Entity handle, for tracking one grenade across frames
origin {x,y,z} When scene node present
timerRemaining / timerTotal number Seconds; smoke counts volume left, flash counts fuse. -1 = nothing to draw for this type
for _, t in ipairs(aqua.get_throwables()) do
if t.origin then
print(t.type, string.format("%.1fs", t.timerRemaining or -1))
end
end