FANDOM


Container Disappear When Empty

What it does

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


Notes

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

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);
  }
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.