GetWorldItemsNear
The level’s loose item slots around a point - what each holds and whether it is taken.
Every item slot of the level’s tables export within the radius, nearest first, at most max (100, up to 1000): its key, the
item class it holds, its place, and whether its item is taken now. A mode’s view of a house’s, a stall’s or a shrine’s
things - to price a theft, to guard a table, to put things back. Empty when the server runs without the tables export.
Syntax
Section titled “Syntax”GetWorldItemsNear(x, y, z, radius [, max])| Parameter | Type | |
|---|---|---|
x |
number | the point, metres |
y |
number | |
z |
number | |
radius |
number | metres |
max |
number | the most to list (100) (optional) |
Returns
Section titled “Returns”table - a list of {key=, class=, x=, y=, z=, taken=, interactable=} (interactable false while SetWorldItemInteractable has the slot switched off)
Example
Section titled “Example”local x, y, z = GetPlayerPos(pid)local missing = 0for _, slot in ipairs(GetWorldItemsNear(x, y, z, 10)) do if slot.taken then missing = missing + 1 endendSendClientMessage(pid, COLOR_SERVER, missing .. " thing(s) are missing from this house")See also
Section titled “See also”ResetWorldItem · GetWorldItem · GetNearestWorldItem · SetWorldItemInteractable · the Doors and containers group of the index
