Skip to content

ResetWorldItems

Gives the level back every taken loose item, or those near a point.

ResetWorldItem for every slot somebody emptied - or, with a point and a radius, for those whose item lay within that many metres of it. Returns how many came back.

The server’s record changes at once (GetWorldItem and GetTakenWorldItems answer the new state straight away); the players near each item are told a share each tick, so a batch of hundreds never floods the connection, and a player far away is told when they come near (the server’s [aoi] radius). The same goes for the restock period’s own returns and TakeWorldItem, so a mode never needs to spread such a batch out itself. A player who takes an item before their game was told is never shown it back.

ResetWorldItems([x, y, z, radius])
Parameter Type
x number the point, metres (all four left out = every taken slot) (optional)
y number (optional)
z number (optional)
radius number metres, above 0 (a point without a radius gives nothing back - never the whole level by a forgotten argument) (optional)

number - how many items came back

ResetWorldItems() -- the whole level as it was
ResetWorldItems(x, y, z, 15) -- the house the thief emptied

ResetWorldItem · GetTakenWorldItems · the Doors and containers group of the index