Lua SDK
Getting started
A script is a Lua file with two optional entry points and a settings card:
lua
Loading…
A script is a Lua file with two optional entry points and a settings card:
menu.group("My Script") -- settings card title
menu.slider('fov', 'Aim FOV', 10, 300, 120, 'px')
menu.keybind('aimkey', 'Aim key', 'Mouse2')
function on_tick()
local me = util.me()
if not me then return end -- not in a match / dead
if not util.held(menu.get_str('aimkey')) then return end
local e = util.best_enemy({ fov = menu.get('fov'), bone = 'chest' })
if e then util.aim_at_bone(e, 'chest', 6) end
end
function on_draw()
draw.text_centered('active', screen.center_x(), 40, draw.color(80, 255, 80))
end
Create the script in the Scripts tab, optionally bind it to specific heroes, and enable it.
The loader compiles it once; whenever your current hero matches the binding, a private
sandbox activates and starts receiving on_tick() every engine tick and on_draw() every
render frame. Hero swap, disable, delete, or a script error tears the sandbox down (pending
taps are dropped so a dead script never keeps firing). Values declared with menu.* appear
in the menu and persist across sessions.
util.me() - outside a match everything else is empty anyway.e.id, not the table, across ticks
(or use util.sticky_enemy, which does it for you).mouse.aim takes one clamped
20-30 deg step per tick - call it every tick and let it converge over several ticks.
Write your own smoothing only if you have to (util.aim_at covers most cases).key.hold / mouse.down assert for the current frame
only - call them every tick. key.tap fires a randomized 2-5 tick pulse.sdk.version() if you share scripts across builds.menu.* param type and its limits.Last updated 2026-10-03