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.
Syntax
Section titled “Syntax”SetContainerItems(key, items)| Parameter | Type | |
|---|---|---|
key |
string | the container’s level name |
items |
table | a list of {class=, amount=, health=} (amount and health optional) |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”-- the arena's armoury restocks between roundsSetContainerItems(ARMOURY, { {class = GetItemClass("longSwordDuel"), amount = 2}, {class = GetItemClass("arrow_normal"), amount = 60}, {class = GetItemClass("bandage"), amount = 5, health = 100},})See also
Section titled “See also”GetContainerItems · GetContainerUser · GetItemClass · the Doors and containers group of the index
