
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)
closeitems
Categories
Item
Parameters
- id
- range
Info
Returns a Lua table with all IDs of items which are close to the player specified with the id parameter. Only dropped items which are within the range will be returned. The unit for the range is tiles (range 1 equals 32 pixels for example)
Sample 1: List the names of all items which are close (within range of 5 tiles) to player 1
Sample 1: List the names of all items which are close (within range of 5 tiles) to player 1
local itemlist=closeitems(1,5)
for _,id in pairs(itemlist) do
print(item(id,"name"))
end
for _,id in pairs(itemlist) do
print(item(id,"name"))
end






