Skip to content

OnPlayerOpenContainer

A player wants to open a container - return false to refuse.

Nothing has opened yet. Return false and the container stays shut for them. Otherwise their client’s loot window opens on the record’s contents (GetContainerItems) and they hold the container until they close it.

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

false refuses; anything else lets them open it

function OnPlayerOpenContainer(pid, key)
if IsPlayerInZone(pid, arena) then return false end -- no rummaging mid-duel
end

OnPlayerCloseContainer · GetContainerItems · GetContainerUser · the Doors and containers group of the index