OnUnlock

From NWN Lexicon
Jump to navigationJump to search

The script attached to this event fires when an item has been unlocked. Giving experience to the unlocker, or even making sure they cannot unlock it in combat (using SetLocked to re-set the lock).


Trigger

Door or placeable was unlocked.


Function(s)

GetLastUnlocked() returns the creature that unlocked OBJECT_SELF.


Remarks

This is triggered only when a creature is unlocking the door or placeable via. ActionUnlockObject using the Open Lock skill or by possessing the relevant Key.

SetLocked will not, nor will DM Force lock, so take care assuming that it will always fire if a lock is unlocked.

The event OnFailToOpen will fire if there is a key required but the person trying to unlock the door does not possess it.


See Also

functions: 

GetLastUnlocked() OnFailToOpen