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.
Syntax
Section titled “Syntax”function OnPlayerOpenContainer(pid, key) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
key |
string | the container’s level name |
Returns
Section titled “Returns”false refuses; anything else lets them open it
Example
Section titled “Example”function OnPlayerOpenContainer(pid, key) if IsPlayerInZone(pid, arena) then return false end -- no rummaging mid-duelendSee also
Section titled “See also”OnPlayerCloseContainer · GetContainerItems · GetContainerUser · the Doors and containers group of the index
