PoA_PRC8/module/nss/spawnplaceables.nss
Jaysyn904 128e7e59a4 Initial upload
Initial upload
2022-10-07 14:20:31 -04:00

80 lines
2.0 KiB
Plaintext

//Created by Guile 3/14/07
//Place this script in the Event (OnEnter) of a trackstrigger or an area
location lTarget;
object oSpawn;
object oTarget;
object oObject;
void main()
{
object oPC = GetEnteringObject();
//Check to make sure it's a pc or stop the script here
if (!GetIsPC(oPC)) return;
//Replace tagname in this script with the actual tag name of the placeable.
//resref name is the unique blueprint name It's not the same as a tagname
//Make sure you place the proper name for each placeable in the proper place!
oObject = GetWaypointByTag("WP_tagname_01");
if (!GetIsObjectValid(GetNearestObjectByTag("tagname1", oObject)))
{
oTarget = GetWaypointByTag("WP_tagname_01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "resrefname", lTarget);
}
oObject = GetWaypointByTag("WP_tagname_01");
if (!GetIsObjectValid(GetNearestObjectByTag("tagname1", oObject)))
{
oTarget = GetWaypointByTag("WP_tagname_01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "resrefname", lTarget);
}
oObject = GetWaypointByTag("WP_tagname_01");
if (!GetIsObjectValid(GetNearestObjectByTag("tagname1", oObject)))
{
oTarget = GetWaypointByTag("WP_tagname_01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "resrefname", lTarget);
}
oObject = GetWaypointByTag("WP_tagname_04");
if (!GetIsObjectValid(GetNearestObjectByTag("tagname4", oObject)))
{
oTarget = GetWaypointByTag("WP_tagname_04");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "resrefname", lTarget);
}
oTarget = GetObjectByTag("tagnameofplaceable");
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
oTarget = GetObjectByTag("tagnameofplaceable2");
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
oTarget = GetObjectByTag("tagnameofplaceable3");
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
oTarget = GetObjectByTag("tagnameofplaceable4");
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
}