OnClose
From NWN Lexicon
Contents |
[edit] OnClose
The script attached to this event fires when the object is closed and can be used to analyze the contents of the container and open a nearby door or raise an alarm after the PC thinks they they have gotten away with the gold scott free.
[edit] Trigger
When a door or placeable object has been closed.
[edit] Function(s)
GetLastClosedBy() returns the object that closed OBJECT_SELF.
[edit] Remarks
Not all placeable objects fire this event; only those that can actually be closed do.
[edit] Example
// put in a chest (obviously this will not work on a door) // if the chest's inventory is empty, give it 100 gold pieces void main() { // see if we have an item object oItem = GetFirstItemInInventory(); if (!GetIsObjectValid(oItem)) { CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 100); } }
[edit] See Also
functions: |