Skip to content

SetContainerItems

Rewrites a container’s contents; the next opener sees the new list.

Each entry is a stack: the item class GUID (names are not resolved here - GetItemClass turns a name or an id into the GUID), an amount (1) and a condition in percent (100). An empty list empties the chest. Items taken from a container the server filled are the server’s own in the item check. A player who has the chest open keeps the list their screen shows until they open it again - what they take is still limited to what it showed, and what they put in goes to the new contents; the next opener finds the new list. An entry with an id is one of the mode’s tagged items (one item, with its name and text - GivePlayerTaggedItem): a letter left in a chest for a player to find, which keeps its tag in their bag.

SetContainerItems(key, items)
Parameter Type
key string the container’s level name
items table a list of {class=, amount=, health=, quality=} (amount, health and quality optional; id, name, text for a tagged item)

nothing

-- the arena's armoury restocks between rounds
SetContainerItems(ARMOURY, {
{class = GetItemClass("longSwordDuel"), amount = 2},
{class = GetItemClass("arrow_normal"), amount = 60},
{class = GetItemClass("bandage"), amount = 5, health = 100},
})

GetContainerItems · GetContainerUser · GetItemClass · the Doors and containers group of the index