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.
Syntax
Section titled “Syntax”function OnContainerRestock(key) -- ...end| Parameter | Type | |
|---|---|---|
key |
string | the container’s level name |
Returns
Section titled “Returns”false keeps the contents for another period; anything else lets the roll happen
Example
Section titled “Example”-- the armoury refills only between roundsfunction OnContainerRestock(key) if key == ARMOURY and round_running then return false endendSee also
Section titled “See also”RestockContainer · GetContainerInfo · SetContainerPreset · the Doors and containers group of the index
