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

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Lua Command Lua Commands

Category: all (85)

Lua Command closeobjects



  • x
  • y
  • radius
  • [type] (optional)


Returns a list of objects which are within the specified radius (in pixels) around the specified position (X|Y) in pixels. Use type to limit the search to objects with a certain type only.

Object types are:
CS2D Dynamic Objects

Sample 1: Get the IDs of objects which are close (300 pixel radius) around the top left corner (0|0) of the map:
local objectlist=closeobjects(0,0,300)
for _,id in pairs(objectlist) do

Note: The position (X|Y) and the radius are specified in PIXELS!