CS2
CS2 scripting
Lua 5.4 scripts for CS2: draw on the overlay, read players and the map, add settings and act through approved scripts.
LanguageLua 5.4.9
Guides25
API entries292
Start here
Getting startedWhere scripts live, the Scripts tab, loading, the console and reload on file change.Your first scriptMake a script from the template, run it, add a setting, print and read an error.How scripts runThe top level and callbacks, every event, the time budget, memory, errors, nil values and the limits.PermissionsThe six switches, what is always available, checking for nil and action approvals.
Tutorials
Drawing on screenBuild a clock while learning shapes, text, colours, fonts, images and clipping.Reading players and entitiesBuild name tags, health bars and damage numbers from the player list and game events.Your own settingsBuild a crosshair with checkboxes, sliders, combos, colours, keybinds and buttons.Input and keysBuild a keystrokes display from keys, mouse buttons and the user's CS2 binds.Files, storage and HTTPBuild a kill log with storage, files and JSON, then fetch data from the web.Using it with an AI assistantThe llms.txt files, the MCP server and how to ask for a script.
Examples
HelloA line of text you set in the menu.HUD panelAn info panel with frame rate, time, map, players and health.Kill counterKills per round, per map and of all time in a HUD chip.Custom box ESPFull or corner boxes with health, name, weapon and distance.Bomb timerThe C4 countdown over the bomb, with the defuse.HTTP statusPolls a JSON address every 30 seconds.SkeletonBone lines and a head dot for every enemy.Spectator listWho is spectating, with the people watching you in red.Grenade timersTime left on smokes, fires and grenade fuses.Now playingThe current song with its cover, and keys to pause and skip.Hologram chamsEnemies as scanning holograms with a custom shader.
Advanced
Map traces and the worldLine of sight, traces, wallbang damage, smokes, grenade paths and the minimap.Custom shadersChams materials with your own HLSL, params, textures and the GPU budget.Aim, attack and keysReading the built in aim and trigger, then acting through approved scripts.Changing evasive's settingsRead and change settings and switch profiles.
API reference
Events, the script and globalsCallbacks, the script object, time, logging and the global helpers.Drawing and coloursShapes, text and images on the overlay, colours, and the old render aliases.Settings UI and configYour script's own settings, and evasive's settings and profiles.Input and keysKeys, the mouse and the user's CS2 binds.Aim, attack and keysActing through approved scripts.Game, entities and playersThe match, players, the local player and the constants that go with them.World and combatMap traces, smokes, grenades and combat.Custom shadersChams materials with your own HLSL.Storage, files, JSON and HTTPSaving data, files, JSON, web requests and maths helpers.MediaWhat is playing on the PC, and its controls.