Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

CS2D Command spawnprojectile

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):
items

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 Hook Lua Hooks

Lua Command Lua Commands