Skip to content

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.

GetContainerItems(key)
Parameter Type
key string the container’s level name

table - a list of {class=, amount=, health=}; nil when never opened

local items = GetContainerItems(key)
if items then
for _, stack in ipairs(items) do Log(GetItemName(stack.class), "x", stack.amount) end
end

SetContainerItems · GetContainers · OnPlayerCloseContainer · the Doors and containers group of the index