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

CS2D Command CS2D Console Commands

Category: server (201)

CS2D Command spawnnpc



  • type (1-X): npc type
  • x (0-X): x pos in tiles
  • y (0-X): y pos in tiles
  • rot (0-360): rotation


Create an NPC (as server only).

NPC types:
1 - zombie
2 - headcrab
3 - snark
4 - vortigaunt
5 - soldier

Note: NPCs are actually objects as well - with type 30. the type of the NPC is saved in the player attribute of the object. So you could also use spawnobject with proper parameters to create NPCs.

Attention: Huge numbers of NPCs can slow down the game and lead to lags!

Lua Hook Lua Hooks

Lua Command Lua Commands