GetLastUsedBy()

From NWN Lexicon
Jump to navigationJump to search

Get the last object that used the placeable object or door that is calling this function.

object GetLastUsedBy();

Description

Returns the last object that used the placeable or door object that is calling this function. Used in the OnUsed event.

Returns OBJECT_INVALID if it is called by something other than a placeable or a door.


Remarks

See GetLastOpenedBy for a similar function used in the OnOpen event.

Example

void main()
{
    object oUser = GetLastUsedBy();
    if (GetIsObjectValid(oUser))
    {
        SpeakString("I was last used by: " + GetName(oUser));
    }
}

See Also

functions: 

GetLastOpenedBy

events: 

OnUsed Event



 author: Jody Fletcher, editor: John Shuell