Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- Console Commands are entered in console, executed with key-binds, cfg-files or with Lua parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands
Lua Hooks
turretscan
Categories
Parameters
- turret object id: id of turret which is scanning the environment for targets
- turret team: 0 = neutral, 1 = terrorist, 2 = counter-terrorist
- turret x position: X position of turret on map (center of turret in pixels)
- turret y position: Y position of turret on map (center of turret in pixels)
Info
Executed whenever a turret scans the environment for an enemy.
The default behavior (which kicks in when returning 0) is to attack the closest enemy which is in sight.
You can return a player ID (1-32) to attack that specific player or -1 to attack no player at all.
The default behavior (which kicks in when returning 0) is to attack the closest enemy which is in sight.
You can return a player ID (1-32) to attack that specific player or -1 to attack no player at all.
Note: Specifying an allied player will make the turret shoot at the player but depending on settings (friendly fire) he might not get hurt
Note: Turrets can only attack players and no specific positions or objects
Return Values
- 0: proceed normally (normal scan & attack closest enemy player)
- 1-32: attack player with that ID (may not cause damage depending on team)
- -1: stay idle and attack nobody