Fixed Nicky's store
Fixed Nicky's store. Made Dirt Mounds & Polar Bears respawn. Full compile.
This commit is contained in:
22
_module/nss/plc_respawn_oc.nss
Normal file
22
_module/nss/plc_respawn_oc.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
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));
|
||||
}
|
||||
Reference in New Issue
Block a user