22 lines
582 B
Plaintext
22 lines
582 B
Plaintext
void RespawnPlaceable(location lSpawn)
|
|
{
|
|
object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, GetTag(OBJECT_SELF), lSpawn);
|
|
SetLocalInt(oNew, "Respawning", FALSE);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object oSelf = OBJECT_SELF;
|
|
location lSpawn = GetLocation(oSelf);
|
|
|
|
// Check if placeable is empty
|
|
object oItem = GetFirstItemInInventory(oSelf);
|
|
if (GetIsObjectValid(oItem))
|
|
{
|
|
return; // Do nothing if it has items inside
|
|
}
|
|
|
|
SetLocalInt(oSelf, "Respawning", TRUE);
|
|
DestroyObject(oSelf, 0.0);
|
|
DelayCommand(7200.0, RespawnPlaceable(lSpawn));
|
|
} |