wolfhacklua API 1.1 Forum

data

Copies of what the overlay has read from the game: the local player, the players of the teams whose ESP is on, the bomb, dropped items and grenades.

since 1.0no permission needed

data.snapshot() is always available and returns copies, never addresses or pointers. It returns one table per frame, the same table for every call in that frame, so calling it twice is free. Treat it as read-only.

Two things to know:

  • Players are only those of the teams whose ESP is switched on in the overlay's menu, and per-player flags (scoped, flashed, defusing, ...) are true only when the ESP has read them, which depends on its settings. If you see no players, check the ESP.
  • The local player's table is called local, which is a Lua keyword, so read it as snap["local"], not snap.local.

items and projectiles come from the world scanner and are absent when empty, so test for them before looping.

Reference#

data.snapshot#since 1.0

data.snapshot(): Snapshot

The game state as the overlay has it this frame.

ReturnsDescription
SnapshotThe frame's snapshot, see Snapshot.
lua
local snap = data.snapshot()
if snap.in_game and snap["local"] then
  log.info("health " .. snap["local"].health .. " on " .. snap.map)
end
for _, p in ipairs(snap.players) do
  if not p.teammate then log.info(p.name .. " " .. p.distance .. " m") end
end

data.world_to_screen#since 1.0

data.world_to_screen(x: number, y: number, z: number): number | nil, number

Projects a world position to screen pixels with this frame's view matrix. Use it with a player's x, y, z.

ParameterTypeDescription
xnumberWorld x.
ynumberWorld y.
znumberWorld z.
ReturnsDescription
number | nilScreen x, or nil when the point is behind the camera.
numberScreen y.
lua
events.on("draw", function()
  for _, p in ipairs(data.snapshot().players) do
    local sx, sy = data.world_to_screen(p.x, p.y, p.z + 72)
    if sx then draw.text(sx, sy, 0xFFFFFFFF, p.name, { align = "center" }) end
  end
end)

Snapshot#

What data.snapshot() returns.

FieldTypeDescription
frameintegerFrame number.
timenumberScript time in seconds.
in_gamebooleanA match is loaded.
mapstringMap name, empty outside a match.
menu_openbooleanThe overlay menu is open.
fpsnumberOverlay frames per second.
frame_msnumberMilliseconds the last frame took.
screen{w, h}Overlay size in pixels.
localtable | nil{team, health, x, y, z, pitch, yaw} of the local player; absent when there is none. Read it as snap["local"].
playersPlayer[]See Player.
bombtable{planted, seconds, defusing, site, length, defuse_remaining, defuse_length}.
itemsDroppedItem[] | nilDropped weapons and items: {x, y, z, kind, name, clip, reserve}.
projectilesProjectile[] | nilGrenades: {x, y, z, type, detonated}; type is he, flash, smoke, molotov, incendiary or decoy.

Player#

One entry of snapshot.players. Positions are world units; distance is in metres.

FieldTypeDescription
indexintegerEntity index.
namestringPlayer name.
weaponstringWeapon name.
teamintegerTeam number.
healthintegerHealth.
armorintegerArmour.
moneyintegerMoney.
clipintegerRounds in the magazine (-1 when unknown).
max_clipintegerMagazine size.
localbooleanThis is the local player.
teammatebooleanSame team as the local player.
visiblebooleanWhether the overlay considers the player visible to the local player (the ESP's visibility result).
xnumberWorld x.
ynumberWorld y.
znumberWorld z (feet).
yawnumberView yaw in degrees.
pitchnumberView pitch in degrees.
speednumberHorizontal speed.
distancenumberDistance from the local player in metres.
scopedbooleanScoped in.
defusingbooleanDefusing the bomb.
flashedbooleanBlinded by a flashbang.
reloadingbooleanReloading.
helmetbooleanHas a helmet.
kitbooleanHas a defuse kit.
has_bombbooleanCarries the bomb.
duckedbooleanCrouching.
on_groundbooleanStanding on the ground.
API 1.1 · source docs-src/api/data.json