game
game - Game state#
Match state, entity lists, ult threats and coordinate projection.
game.local_player#
game.local_player() → entity table | nil
The local player's entity table. Nil outside a match - gate every script with util.me() instead of calling this directly.
game.enemies#
game.enemies() → array of entity tables
Alive enemy combatants (strict combatant filter - never health packs, deployables or world NPCs). In FFA/custom lobbies every combatant is an enemy. Tables are rebuilt every tick; use e.id for cross-tick tracking.
game.teammates#
game.teammates() → array of entity tables
Alive confirmed teammates (empty in FFA/custom). Same combatant gate as game.enemies.
game.all_entities#
game.all_entities() → array of entity tables
Every alive combatant regardless of team.
game.is_in_match#
game.is_in_match() → boolean
True while the engine considers the game in a playable match.
game.local_team#
game.local_team() → number
Local team id, -1 when unknown.
game.local_hero#
game.local_hero() → string | nil
Local hero name (e.g. 'Genji'), nil when unknown.
game.is_scoped#
game.is_scoped() → boolean
True while the local player is scoped (Widow/Ana/Ashe ADS).
game.ult_threats#
game.ult_threats([max_range], [min_facing_dot], [save_range]) → array of threat tables
Enemies currently FIRING their ult (fire event, not charge %) that threaten you or a teammate. Each entry: { enemy, towards_you, dot, teammate? }. A threat surfaces only after a randomized 150-300 ms delay, shared by all scripts. Unknown enemy facing passes the cone check as 'unverified' so scripts degrade to range-only.
| Parameter | Type | Default | Description |
|---|---|---|---|
max_range | number | 40 | Max enemy distance (m) to consider. |
min_facing_dot | number | 0.25 | Min dot(enemy facing, direction to target) for the facing cone. |
save_range | number | 25 | Max distance (m) between you and a saveable teammate. |
game.camera_pos#
game.camera_pos() → { x, y, z }
Camera world position. Zeros when unknown - util.lead_world treats zeros as unavailable.
game.world_to_screen#
game.world_to_screen(x, y, z) → { x, y } | nil
Project a world point to overlay pixels. Nil when behind the camera or the view matrix is unavailable.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | number | (required) | World X coordinate. |
y | number | (required) | World Y coordinate. |
z | number | (required) | World Z coordinate. |
Last updated 2026-10-03