// Treasure OnClose script
//::////////////////////////////////////
#include "x0_i0_treasure"
const float RESTOCK_TREASURE_DELAY = 900.0; // How long until chest will respawn treasure (in seconds).
void DestroyChestContents()
{ object oItem = GetFirstItemInInventory();
while( GetIsObjectValid( oItem))
{ DestroyObject( oItem, (GetHasInventory( oItem) ? 0.2 : 0.1));
oItem = GetNextItemInInventory();
}
}
void main()
{
DelayCommand(60.0, DestroyChestContents());
DelayCommand( RESTOCK_TREASURE_DELAY +0.01, CTG_SetIsTreasureGenerated( OBJECT_SELF, FALSE));
}
(Posted by Pattycake initially)It will work right?
I mean assuming you have the normal scripts on the containers OnOpened event and so on...
Modifié par SuperFly_2000, 05 août 2010 - 11:55 .





Retour en haut







