Skip to content

OnContainerRestock

A touched chest’s restock period ran out and somebody is opening it - return false to hold it.

The server is about to roll the chest’s loot preset again: what players took comes back, what they put in is gone (the game’s own rule). Return false and the chest stays as it is for one more period. The period is [containers] restock: the chest’s own from the level (seven world days unless the level says otherwise), a number of world days, or never.

function OnContainerRestock(key)
-- ...
end
Parameter Type
key string the container’s level name

false keeps the contents for another period; anything else lets the roll happen

-- the armoury refills only between rounds
function OnContainerRestock(key)
if key == ARMOURY and round_running then return false end
end

RestockContainer · GetContainerInfo · SetContainerPreset · the Doors and containers group of the index