Skip to content

ResetWorldItem

Gives the level its own loose item back, in its place, on every client.

The slot’s record goes and every player’s game shows the level’s item where it lay again - on the table, the rack, the shelf - including a player who took it (their own copy stays theirs). A pickup that stood in for it (RespawnWorldItem) is taken away. This is what the restock period does by itself; a mode calls it to reset a house after a robbery, a stall at the day’s start, a whole town between rounds. false for a slot that holds its item.

ResetWorldItem(key)
Parameter Type
key string the item slot’s level name

boolean

-- the merchant's table is laid again at dawn
for _, slot in ipairs(GetWorldItemsNear(STALL_X, STALL_Y, STALL_Z, 4)) do
if slot.taken then ResetWorldItem(slot.key) end
end

ResetWorldItems · GetWorldItemsNear · OnPlayerTakeWorldItem · the Doors and containers group of the index