A Basic thing not working spawn script

So this aint working:

void main()
{
	object oPC = GetExitingObject();
	
	if (!GetIsPC(oPC)) return;
	
	object oTarget;
	object oSpawn;
	location lTarget;
	int nWp_Raven_Number = 1;
	
	while(oTarget != OBJECT_INVALID && nWp_Raven_Number < 16)
	{
		oTarget = GetWaypointByTag("wp_raven_" + IntToString(nWp_Raven_Number));
		
		lTarget = GetLocation(oTarget);
		
		oSpawn = CreateObject(OBJECT_TYPE_PLACED_EFFECT, "fx_amb_raven", lTarget);

		nWp_Raven_Number += 1;
	}
}

What’d I forget or do wrong, please?

never mind lol’

I changed

oTarget != OBJECT_INVALID

to

oPC != OBJECT_INVALID

works properly now.

1 Like