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
mp_building_limitCategories
Parameters
- building (text): name of a building
- limit (0-X): limit
Info
Set the build limit for a building. Each player can only build the specified amount of that building.
The value can also be set to 0 to disallow building that building.
Buildings (Class 1 only!):
Note: This will not affect buildings which are already built. e.g. if you already built 3 turrets, setting the limit to 0 will NOT destroy the turrets (but you won't be able to build more afterwards).
Attention: Make sure that you use the name exactly as the building is called in-game (see list above).
Attention: This does not affect upgrades. You can upgrade buildings always - even if you exceed the limit by doing that.
Examples:
mp_building_limit "Wall I" 5
Lua Hooks
Lua Commands
Categories
Parameters
- building (text): name of a building
- limit (0-X): limit
Info
Set the build limit for a building. Each player can only build the specified amount of that building.
The value can also be set to 0 to disallow building that building.
Buildings (Class 1 only!):
Examples:
mp_building_limit "Wall I" 5
The value can also be set to 0 to disallow building that building.
Buildings (Class 1 only!):
Note: This will not affect buildings which are already built. e.g. if you already built 3 turrets, setting the limit to 0 will NOT destroy the turrets (but you won't be able to build more afterwards).
Attention: Make sure that you use the name exactly as the building is called in-game (see list above).
Attention: This does not affect upgrades. You can upgrade buildings always - even if you exceed the limit by doing that.
Examples:
mp_building_limit "Wall I" 5