GetNearestWorldItem
The loose item slot nearest to a point, within a radius.
Syntax
Section titled “Syntax”GetNearestWorldItem(x, y, z [, radius])| Parameter | Type | |
|---|---|---|
x |
number | the point, metres |
y |
number | |
z |
number | |
radius |
number | metres; 0 or none = no limit (optional) |
Returns
Section titled “Returns”string, number - the slot’s key and its distance; nil when none
Example
Section titled “Example”local key = GetNearestWorldItem(x, y, z, 2)if key then RespawnWorldItem(key) endSee also
Section titled “See also”GetWorldItemPosition · GetNearestDoor · OnPlayerTakeWorldItem · the Doors and containers group of the index
