Recent changes Random page
GAMING
Gaming
 
WoWWiki
Halopedia
FFXIclopedia
Age of Conan
Warhammer Online
Grand Theft Wiki
See more...

Container disappear's when empty

From NWNWiki

Jump to: navigation, search

Tired of looting containers and walking past them later just to forget you already looted them? This script causes a container to vanish after it has been emptied of its loot.

[edit] The Script

/*******************************
Script: Container Disappear When Empty
Created By: Jaden Wagener
Created On: 08/30/02
*******************************/
//Causes a container to be destroyed once the loot inside is taken.
//Should be placed in a placeable container's OnClose slot.
void main()
{
  if (GetIsObjectValid(GetFirstItemInInventory(OBJECT_SELF)) == FALSE)
  {
    DestroyObject(OBJECT_SELF,0.0f);
  }
}

[edit] Notes

Script should be placed in the OnClose slot for the placeable container.

Rate this article:
Share this article: