Recent changes Random page
GAMING
Gaming
 
WoWWiki
Diablo Wiki
Fallout-The Vault
Grand Theft Wiki
Halopedia
StarCraft Wiki
FFXIclopedia
Resident Evil Wiki
See more...

Door and chest

From NWNWiki

Jump to: navigation, search

This script is made by Bioware, but it can be a cool thing to add somewhere on your module!

When you place a Special item in a chest, a door will open and it unlocks (if its locked)!
When you place the "special" item in the chest, it will be destroyed.

[edit] The Script

Place this script in the "OnDisturbed" on the Chest

void main()
{
    object oItem = GetInventoryDisturbItem();
    int nItemBase =  GetBaseItemType(oItem);
    if(GetLocalInt(OBJECT_SELF,"") == FALSE &&
       GetTag(oItem) == "SPECIEL ITEM-TAG" )
    {
        DestroyObject(oItem);
        object oDoor = GetObjectByTag("DOOR-TAG");
        AssignCommand(oDoor,ActionOpenDoor(oDoor));
        SetLocked(oDoor,FALSE);
    }
}

[edit] Notes

  • "SPECIAL ITEM-TAG" = The TAG of the item that must be inserted into the chest to get the door opened!
  • "DOOR-TAG" = The Tag of the door that shall be Opened/Unlocked!
Rate this article:
Share this article: