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
spawnprojectileCategories
Parameters
- player (0-32): id of a player who spawned the projectile (0 if not by player)
- type (1-X): projectile type
- x (0-X): x position in pixels
- y (0-X): y position in pixels
- flydist (0-X): flight distance in pixels
- dir (0-360): flight direction (angle in degrees)
Info
Spawns a projectile (as server only). Projectile type IDs are equal to the IDs of the corresponding weapons.
Use a flydist of 0 to spawn projectiles on the ground.
Weapon and item IDs (weapons with a special projectile are marked with a yellow P):
Note: CS2D will let a regular item fly if the selected item ID does not have a corresponding projectile (no yellow P in the list above). The item will then be collectible as soon as it has hit the ground and doesn't move anymore
Attention: Avoid spawning huge numbers of projectiles! They might cause lags and FPS drops!
Attention: Each player can only have a maximum of 255 projectiles at a time (including projectiles lying on the ground like smoke grenades). Trying to create more projectiles may result in problems (this is because a byte is used for the projectile ID)
Lua Hooks
Lua Commands
Categories
Parameters
- player (0-32): id of a player who spawned the projectile (0 if not by player)
- type (1-X): projectile type
- x (0-X): x position in pixels
- y (0-X): y position in pixels
- flydist (0-X): flight distance in pixels
- dir (0-360): flight direction (angle in degrees)
Info
Spawns a projectile (as server only). Projectile type IDs are equal to the IDs of the corresponding weapons.
Use a flydist of 0 to spawn projectiles on the ground.
Weapon and item IDs (weapons with a special projectile are marked with a yellow P):
Use a flydist of 0 to spawn projectiles on the ground.
Weapon and item IDs (weapons with a special projectile are marked with a yellow P):
Note: CS2D will let a regular item fly if the selected item ID does not have a corresponding projectile (no yellow P in the list above). The item will then be collectible as soon as it has hit the ground and doesn't move anymore
Attention: Avoid spawning huge numbers of projectiles! They might cause lags and FPS drops!
Attention: Each player can only have a maximum of 255 projectiles at a time (including projectiles lying on the ground like smoke grenades). Trying to create more projectiles may result in problems (this is because a byte is used for the projectile ID)