OnPlayerUnlockContainer
A player unlocked a chest with its key or a lockpick - return false to keep it locked.
Their game has already unlocked it. Return false and their chest is locked again (the lockpick’s work undone). Otherwise the
chest is unlocked for everyone - on every screen and for a newcomer - or, where their own lock ruled it
(SetContainerLockedFor), for them alone.
Syntax
Section titled “Syntax”function OnPlayerUnlockContainer(pid, key) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
key |
string | the chest’s key, as OnPlayerOpenContainer gets it |
Returns
Section titled “Returns”false keeps it locked; anything else lets the unlock stand
Example
Section titled “Example”-- the guild's strongbox cannot be pickedfunction OnPlayerUnlockContainer(pid, key) if key == GUILD_CHEST then SendClientMessage(pid, COLOR_RED, "The lock does not give.") return false endendSee also
Section titled “See also”SetContainerLocked · SetContainerLockedFor · OnPlayerOpenContainer · the Doors and containers group of the index
