
Help
Command Reference
You can enter CS2D script commands in the console, save them in cfg-files or bind them to keys. CS2D script commands are no Lua commands but they can still be executed in Lua scripts by using the Lua parse-function!
Commands
Lua Reference
Lua scripting (server-sided) allows server hosters and mappers to modify the game and to add new elements.
Lua Hooks
Lua Commands
Category: item (3)
item
Categories
Item
Parameters
- id
- "value"
Info
Returns a value of an item instance:
Moreover there is:
item(0,"table"): returns a Lua table with all dropped item IDs (the unique instance IDs, NOT the type IDs!)
Item names and type IDs:

Sample 1: Using the item table to list the names of all items
- exists: boolean, true if an item with that ID exists, false otherwise
- name: name of that item
- type: internal item type ID
- player: ID of player that carries this item or 0 if it is dropped
- ammo: ammo supply for that weapon (not loaded in it)
- ammoin: ammo currently loaded into the weapon
- mode: weapon mode (e.g. color of laser, silenced or not)
- x: X position of dropped weapon on map (in tiles)
- y: Y position of dropped weapon on map (in tiles)
- dropped: boolean, true if weapon has been dropped, false otherwise
- droptimer: how long is it ago that the weapon has been dropped (in seconds)
Moreover there is:
item(0,"table"): returns a Lua table with all dropped item IDs (the unique instance IDs, NOT the type IDs!)
Item names and type IDs:

Sample 1: Using the item table to list the names of all items
local itemlist=item(0,"table")
for _,id in pairs(itemlist) do
print(item(id,"name"))
end
for _,id in pairs(itemlist) do
print(item(id,"name"))
end






