Script the cheat.
Draw overlays, react to what happens in the game, build your own menus, read players and the world, and edit the command that is sent every tick. Plain Lua 5.4, loaded from a folder and reloaded with one click.
local group = ui.group( "hello" )
local enabled = group:toggle( "enabled", true )
local white = color( 255, 255, 255 )
on( "frame", function( canvas )
if enabled:get( ) then
canvas:text( 20, 20, "hello", white )
end
end )#What you can do
on() for all of it.
Read players and weaponsHealth, bones, hitboxes, ammo, recoil, the planted bomb, any field the game's schema knows.
Ask the worldRays, boxes and balls through the map, visibility, and the engine's own wallbang maths.
Edit the commandPress and release buttons, turn the view silently, change this tick's movement.
Move the cameraChange the field of view or the camera itself, and project world points to the screen.
Drive the cheatRead and change any setting, watch the doubletap and anti-aim state, add lines to the player overlay.
Reach outsideFiles, JSON, saved state, and for scripts you trust: HTTP requests, the clipboard and raw memory.
#A script in thirty seconds
A script is one .lua file in C:\elysium\scripts. It runs top to bottom when it loads, and from then on it only does what its handlers do:
-- runs once, when the script loads
print( "loaded" )
-- runs every rendered frame
on( "frame", function( canvas )
canvas:text( 20, 20, string.format( "%d fps", math.floor( render.fps( ) + 0.5 ) ), color( 255, 255, 255 ) )
end )
-- runs when someone is hurt
on( "game:player_hurt", function( ev )
ui.notify( "someone got hurt" )
end )
-- runs when the script is switched off or reloaded
on( "unload", function( )
print( "bye" )
end )on( name, handler ) is the one function that connects a script to the cheat. The events page lists every name it takes.
#The modules
| Module | What it is for | Page |
|---|---|---|
on, off, after, every, next_frame | Events and timers | Events & timers |
render, the canvas | Fonts, textures, shapes, text, shaders | Drawing, Shaders |
ui | Groups, windows, every kind of control, toasts | Menus & controls |
ents and entity objects | Players, weapons, projectiles, the bomb, schema fields | Players & entities |
world | Traces, visibility, bullet penetration, damage | Traces & damage |
cmd, btn | The command of the current tick | Editing the command |
view | The camera, world-to-screen projection | Camera & projection |
cheat, esp | The cheat's settings and state, the player overlay | Cheat integration |
game | Map, time, console, sound, chat, particles, convars | Game, console & sound |
input | Keys, mouse, the cheat's hotkeys | Input |
fs, store, json, base64, hash, net, mem | Files, saved state, encodings, network, memory | Files, data & network |
vec3, vec2, color, math | Value types and helpers | Math |
#Conventions in this guide
| You see | It means |
|---|---|
[, rounding] | An optional argument. Leave it out and the default applies. |
a:method() | A method: call it with a colon on the object, not a dot. |
module.function() | A plain function in a module: call it with a dot. |
| trusted | Only available to scripts you switched to trusted. See Sandboxed and trusted. |
| game thread | Has to run on the game's own thread. Called from elsewhere it is queued or refused - the entry says which. |
| event | An event name for on(). |
Distances are in game units, angles in degrees, screen positions in pixels from the top left corner, time in seconds unless a name says ms or ticks. Lists are 1-based, like everywhere in Lua - except the ones that are indexed by a game number such as a bone id, and the entry says so.
#Where to go next
- New to this: Your first script, then How scripts run.
- Know what you want: use the search box (press /) or the API index.
- Want working code to read: Cookbook and Example scripts.
- Something broke: Troubleshooting.