Skip to content

OnPlayerCloseContainer

A player closed a container; the record holds what they left in it.

function OnPlayerCloseContainer(pid, key)
-- ...
end
Parameter Type
pid number the player
key string the container’s level name

nothing

function OnPlayerCloseContainer(pid, key)
local items = GetContainerItems(key) or {}
Log(GetPlayerName(pid), "closed", key, "with", #items, "stacks left")
end

OnPlayerOpenContainer · GetContainerItems · SetContainerItems · the Doors and containers group of the index