game
Live data (read-only, writes raise a Lua error). Accessing a field = the latest published snapshot for the current frame.
game.localplayer
| Field | Type | Description |
|---|---|---|
index | int | entity_list index |
base / self_base | uint64 | Entity memory base — combine with offsets + mem.read/write to self-service read/write any attribute. The two diverge while dead-spectating: base follows the spectated player, self_base is always the real local machine — use self_base to read "my own" attributes |
health / max_health | int | Current / max HP |
shield / max_shield | int | Current / max shield |
origin / camera_origin | Vec3 | Entity / camera position (origin follows the spectated player while dead) |
view_angle | Vec2 | {pitch, yaw} |
sway_angle | Vec2 | Bullet firing direction including breath/sway |
view_offset / punch_angle | Vec3 | View offset / recoil |
abs_velocity | Vec3 | |
flags_raw | uint32 | Raw m_fFlags bits (FL_ONGROUND etc.) |
team_num / squad_id | int | |
platform_uid | string | uint64 → string |
weapon_id | int | Weapon string-table index |
weapon_enum | int | sdk::ItemId value, more reliable than the weapon string |
weapon | string | Weapon name shown in ESP |
weapon_speed / weapon_scale | number | Fire rate / charge-up |
target_zoom_fov | number | ADS fov of the current weapon |
weapon_next_ready_time | number | |
weap_state / burst_fire_index / ammo_in_clip | int | Internal ammo state |
is_semi_auto / is_zooming / is_dead / is_down / is_skydive / is_grenade / is_hands / is_on_ground | bool | |
time_base | number | World time base |
spec_index | int | Spectated target |
backpack_tier | int | 0=None / 1=White / 2=Blue / 3=Purple / 4=Gold |
consumables | table | 16-slot consumable inventory (each slot {item: uint16, count: uint16}; count==0 = empty) |
game.entities.players (iterable via pairs)
Per-PlayerEntity fields:
| Field | Type | Description |
|---|---|---|
index | int | entity_list index |
base | uint64 | Entity memory base — combine with offsets + mem.read/write for self-service reads |
name / weapon / legend / legend_icon_key | string | |
platform_uid | string | uint64 → string |
roster | uint8 | Roster bitmask (pro/celeb/cheater/friends) |
grade / kills / damage / xp | int | Level / kills / damage / experience |
rank / rank_icon_key / rank_color | string | Rank info |
rank_source | int | Raw rank score |
distance | number | Meters |
origin / head_pos / abs_velocity | Vec3 | |
vec_min / vec_max | Vec3 | Collision AABB |
yaw | number | Yaw angle |
team_num / squad_id | int | |
health / shield / max_shield | int | |
flags | int | m_fFlags state bits |
weapon_id | int | Weapon string-table index |
spec_index | int | Whom this player is spectating |
last_visible_time / cloak_endtime | number | Visibility / cloak timestamps |
is_visible / is_down / is_dead / is_teammate / is_cloak / is_npc | bool | |
in_screen / can_draw / has_bones / is_model_blocked / is_glow / is_wall | bool | Rendering-related state |
#game.entities.playersdoes not work (userdata-backed tables have no#) — count withfor _ in pairs(...) do n = n + 1 end.
Skeleton
PlayerEntity exposes 17 bone world positions; pair with game.BONE (part constants) and game.BONE_LINKS (connection table) to draw skeleton ESP.
| Member / constant | Description |
|---|---|
player:bone(idx) | World-space Vec3 of body part idx (0-based body part id); returns a zero vector if out of range or bones not ready |
player:has_fresh_bones() | Whether all 17 bones were actually read this frame (when false, bone() is likely zero — skip) |
game.BONE | Named part constants: head=0, upper_chest, chest, waist, hip, l_shoulder, l_elbow, l_hand, r_shoulder, r_elbow, r_hand, l_thigh, l_knee, l_foot, r_thigh, r_knee, r_foot=16 |
game.BONE_LINKS | Array of {a, b} part-id pairs (matches the native skeleton, 16 segments) |
math.WorldToScreen(world)returns 3 values(sx, sy, ok), not a Vec2.
-- Skeleton ESP: iterate links, project each bone to screen, draw a line
local LINKS = game.BONE_LINKS
event.on("frame_update", function()
for _, p in pairs(game.entities.players) do
if p.is_visible and not p.is_dead and not p.is_teammate and p:has_fresh_bones() then
for _, link in ipairs(LINKS) do
local ax, ay, ok1 = math.WorldToScreen(p:bone(link[1]))
local bx, by, ok2 = math.WorldToScreen(p:bone(link[2]))
if ok1 and ok2 then
draw.line(ax, ay, bx, by, draw.u8(255, 255, 255, 200), 1.5)
end
end
end
end
end)game.entities.loots (iterable via pairs)
Per-LootEntity fields:
| Field | Type | Description |
|---|---|---|
index | int | entity_list index |
base | uint64 | Entity memory base — combine with offsets + mem.read/write for self-service reads |
origin | Vec3 | |
distance | number | Meters |
model_name | string | |
model_hash | uint32 | hash of model_name |
classified_id | int | ItemId enum value |
classified_name / item_id_str / base_name | string | Classified names |
quality_level | int | 0=unknown, 1..5=COMMON..HEIRLOOM |
weapon_name_index | int | Weapon string-table index |
custom_script_int | int | |
context_id | int |
game.entities.projectiles (iterable via pairs)
Per-ProjectileEntity fields:
| Field | Type | Description |
|---|---|---|
index | int | entity_list index |
base | uint64 | Entity memory base — combine with offsets + mem.read/write for self-service reads |
kind | string | "frag" / "thermite" / "arc_star" / "other" / "unknown" |
origin | Vec3 | |
team_num | int | |
dmg_radius | number | m_DmgRadius (0x2f94) |
owner_handle_raw | uint32 | Raw EHandle bits of m_hOwnerEntity |
weapon_class_index | uint16 | m_weaponClassIndex; pair with game.world to look up weapon name |
creation_time | number | Entity birth time (ctx.time at once_read) |
is_throwable | bool | Real player grenade (filters static map props) |
is_enemy / is_local | bool |
game.aimbot (read-only)
| Field | Type | Description |
|---|---|---|
target_index | int | Entity index of the current aimbot target (-1 when no target) |
target_distance | number (meters) | Distance to the current target |
predict_pos | Vec3 | nil | The aimbot's internal predicted target position |
trigger_busy | bool | Whether the trigger decision is currently in a busy state (for custom trigger HUDs) |
trigger | table | Detailed trigger state snapshot (see below, for trigger HUDs) |
weapon_next_ready_timeis ongame.localplayer; trigger state is not its own namespace to avoid duplicate paths.
game.aimbot.trigger
All timestamps are engine-clock seconds (QPC, base::get_time), not time.game()/time.now(). The table includes a same-clock now; use it for countdowns (e.g. ready_in = t.weapon_ready_at - t.now).
| Field | Type | Description |
|---|---|---|
now | number | Current engine clock (QPC seconds), same clock as the timestamps below; use it for countdowns |
busy | bool | In a hold/release-window countdown |
target_index | int | Target being evaluated (0 = none) |
pressed | bool | Already mouse_down |
last_hit | bool | Whether the last evaluation hit |
snapshot_time | number | Game time of this snapshot |
release_at / again_at | number | Planned mouse_up / next-allowed-fire time |
visible_at | number | Target visible start (react timing origin) |
weapon_ready_at | number | Weapon ready time (incl. rdyfudge) |
react_window / again_window / release_window | number | React / re-fire / hold-duration windows |
rdyfudge / radscale | number | Ready offset / radius scale |
aim_offset | Vec3 | Offset of the aim part relative to spine_head |
event.on("frame_update", function()
local t = game.aimbot.trigger
if t.target_index ~= 0 then
local ready_in = math.max(0, t.weapon_ready_at - t.now)
draw.text(20, 200, draw.u8(255,255,255,255),
string.format("trigger: tgt=%d hit=%s ready_in=%.2f",
t.target_index, tostring(t.last_hit), ready_in))
end
end)Custom aim algorithms (movement/smoothing + prediction override)
Scripts can register their own movement algorithm (added to the dropdown) and prediction algorithm (global override). Execution model: callbacks run on the render thread (same thread as the Lua VM — no lock). Smoothing cadence = min(aim publish rate, render FPS) (uncapped render → high rate); prediction is slow-changing, so the render thread computes the aim point and the aim thread consumes it at 500Hz with no cadence loss. The native Normal/PID paths are unaffected.
game.aimbot.solve(shooter, target_pos, target_vel, v0, gravity) → {pitch, yaw, time} | nil
Native ballistic solver (stateless, callable anywhere). pitch/yaw are Source angles (degrees, pitch +down), time is flight time (seconds). v0 ≤ 1 is treated as hitscan (time=0); out of range returns nil. Coordinates are world-space Vec3, velocity u/s, gravity u/s².
game.aimbot.register_algorithm(name, fn)
Register a movement algorithm. name is appended to the aim / trigger Movement Algorithm dropdown; when selected, this algorithm drives mouse smoothing. fn(state) returns dx, dy (mickey delta; the engine accumulates sub-pixel residue). Auto-unregistered on script unload.
Must be called from the script's top-level load body — deferred callbacks (
event.on("frame_update", ...),Delay(),gui.Buttoncallbacks, etc.) are rejected with a throttled log warning, because the owner identity is cleared after load completion and cannot be reliably attributed (would silently leak across scripts). For lazy enable, keepregister_algorithmin the body and gate behavior with a Lua-side flag.
state fields:
| field | type | meaning |
|---|---|---|
err_pitch / err_yaw | number (deg) | current aim error (prediction-compensated + dead-zoned) |
dt | number (s) | time since this algorithm was last called |
distance | number (m) | target distance |
zooming | bool | ADS or not |
mouse_sens | number | in-game sensitivity (for screen-consistent scaling: err/0.022/mouse_sens → mickey) |
target_index | int | target entity index |
shooter / sway | Vec3 / Vec2 | shooter origin / current reference view |
target / velocity | Vec3 | world hit point / target velocity (u/s) |
Sign convention matches native:
dx = -err_yaw·k,dy = err_pitch·k.
game.aimbot.set_predictor(fn)
Globally override the prediction algorithm. fn(target) returns a world aim point Vec3; the aim thread consumes it at 500Hz in place of native solve. Pass nil to clear (fall back to native). target fields: index, shooter, head, origin, velocity (Vec3), distance, v0, gravity.
Same as
register_algorithm— load-body-only. Also one-predictor-per-process: if another script already owns the predictor, calls are rejected silently to Lua (throttled log only). Convention: one predictor per process, or unload the holding script first.
local tab = gui.tab("AimAlgo")
local g = tab:group("g", "Lua Aim Algo", 0, 0, 300, 0)
local gain = g:slider_float("gain", "Strength (mickey/deg)", 0.55, 0.05, 2.0)
local lead = g:checkbox("lead", "Prediction override", true)
-- Adaptive easing smoother: appears in the dropdown, active when selected
game.aimbot.register_algorithm("Lua Adaptive", function(s)
local mag = math.sqrt(s.err_pitch^2 + s.err_yaw^2)
local f = gain:get() * (1.0 - 0.4 * math.exp(-mag)) -- soft near target, full far
return -s.err_yaw * f, s.err_pitch * f
end)
-- Prediction override: reuse native solve for flight time, extrapolate by velocity
game.aimbot.set_predictor(function(t)
if not lead:get() then return t.head end
local sol = game.aimbot.solve(t.shooter, t.head, t.velocity, t.v0, t.gravity)
if not sol then return t.head end
return Vec3(t.head.x + t.velocity.x * sol.time,
t.head.y + t.velocity.y * sol.time,
t.head.z + t.velocity.z * sol.time)
end)game.world
| Field | Type | Description |
|---|---|---|
ring | table | {origin=Vec3, radius_start=N, radius_end=N, time_start=N, time_end=N, is_active=bool}; radius / origin are in game units (≈ inches), divide by 39.37 for meters |
map_name | string | Current map string |
game top-level methods
| Method | Returns | Description |
|---|---|---|
game:is_in_game() | bool | Whether currently in a match (signon_state + not in lobby/match-making) |
game:signon_state() | int | Raw client_state.signon_state |
Example
local lp = game.localplayer
if lp.is_dead then return end
for _, p in pairs(game.entities.players) do
if (not p.is_teammate) and p.is_visible and p.distance < 50 then
log.info("Enemy " .. (p.name or "?") .. " at " .. p.distance .. "m")
end
end
if game.world.map_name == "mp_rr_arena_skygarden" then
-- ...
end