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
Lua Commands
ai_iattackCategories
Parameters
- id
Info
Bot with given ID performs an intelligent attack.
This includes some additional logic:
- If the current weapon has limited ammo, is empty and has spare ammo, a reload will be triggered and attacking will continue after reloading
- If the current weapon is entirely empty (no spare ammo), switch to the next best weapon which can be used for attacking (in most cases pistol or melee)
Note: If you just want to trigger a primary or secondary attack without additional logic you can use ai_attack instead.
Categories
Parameters
- id
Info
Bot with given ID performs an intelligent attack.
This includes some additional logic:
This includes some additional logic:
- If the current weapon has limited ammo, is empty and has spare ammo, a reload will be triggered and attacking will continue after reloading
- If the current weapon is entirely empty (no spare ammo), switch to the next best weapon which can be used for attacking (in most cases pistol or melee)
Note: If you just want to trigger a primary or secondary attack without additional logic you can use ai_attack instead.