GetLastLocked(object)

From NWN Lexicon
Jump to navigationJump to search

Get the last object that locked the given object.

object GetLastLocked(
    object oObject = OBJECT_SELF
);

Parameters

oObject
The object to check who last locked them (default: OBJECT_SELF).

Description

Returns the last object that locked oObject.

Returns OBJECT_INVALID if oObject is not a valid door or placeable. Also returns OBJECT_INVALID if the object was created locked in the Toolset and hasn't been locked since.


Remarks

Calling SetLocked on an object will cause the object that script is run on to be the last locker. Unless it is called inside an AssignCommand, in which case it will return the object the SetLocked was assigned to.

Calling SetLocked on a locked door will still change the value of GetLastLocked accordingly.


Version

This function was updated in 1.89.8193.37 of NWN:EE. VM: Added oObject parameter to GetLastLocked().


See Also

functions: 

GetLastUnlocked



 author: John Shuell, editor: Lilac Soul