GetContainerItems
A container’s contents of record.
One entry per stack: the item class GUID (GetItemName names it), how many, the item’s condition in percent. nil when
nobody has opened the container yet - its contents are still the level’s own, unknown to the server.
Syntax
Section titled “Syntax”GetContainerItems(key)| Parameter | Type | |
|---|---|---|
key |
string | the container’s level name |
Returns
Section titled “Returns”table - a list of {class=, amount=, health=}; nil when never opened
Example
Section titled “Example”local items = GetContainerItems(key)if items then for _, stack in ipairs(items) do Log(GetItemName(stack.class), "x", stack.amount) endendSee also
Section titled “See also”SetContainerItems · GetContainers · OnPlayerCloseContainer · the Doors and containers group of the index
