Skip to content

SetContainerItems

Rewrites a container’s contents; whoever has it open 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 inventory audit.

SetContainerItems(key, items)
Parameter Type
key string the container’s level name
items table a list of {class=, amount=, health=} (amount and health optional)

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