evasivedocs
CS2 scriptingLua 5.4.9 · 25 guides · 292 API entries
API reference

API reference

The CS2 scripting API: 35 namespaces and 292 entries, one page per group. Each entry gives its signature, what it does, its arguments and what it returns, with a short example where one helps.

Pages

PageWhat it coversNamespaces
Events, the script and globalsCallbacks, the script object, time, logging and the global helpers.events, script, Globals, time, log
Drawing and coloursShapes, text and images on the overlay, colours, and the old render aliases.draw, color, render (compat)
Settings UI and configYour script's own settings, and evasive's settings and profiles.ui, config, Control
Input and keysKeys, the mouse and the user's CS2 binds.input, vk
Aim, attack and keysActing through approved scripts.keys, aim, attack, act
Game, entities and playersThe match, players, the local player and the constants that go with them.game, entities, Player, LocalPlayer, bone, hitgroup, weapon_type
World and combatMap traces, smokes, grenades and combat.world, combat
Custom shadersChams materials with your own HLSL.scene, Material
Storage, files, JSON and HTTPSaving data, files, JSON, web requests and maths helpers.storage, files, json, http, math
MediaWhat is playing on the PC, and its controls.media, MediaSession

Permissions

Some entries need a switch in Scripts > Security. Their entry says which. Permissions explains them.

SwitchStartsWhat it allows
Allow game scriptingongame.*, entities.*, world.* and combat.*: players, the bomb, the camera, map traces and what aim and trigger do. Read-only.
Allow internet connectionsoffhttp.*: 4 requests at once, 10 s timeout, 2 MiB responses.
Allow scripts to edit cfg filesoffconfig.*: read and change evasive's own settings and configs.
Allow insecure FFIoffFull io, os and debug libraries. Gives a script your files and processes; keep it off unless you wrote the script.
Allow custom shadersoffscene.* and Player:set_material: chams materials with the script's own HLSL pixel shader, run on your GPU. A slow one is switched off by itself. While the switch is off, scene is nil.
Allow scripts to aim, shoot and press keysoffaim.*, attack.*, keys.*, act.status and input.press / down / up / hold / release_all: move your view, fire and press keys, only through the Aim and Trigger safety gates and never while the menu is open or CS2 is in the background. Each version of a script also needs your approval. Off while Allow insecure FFI is on.