Code: Select all
script 52 (void) {
int PX, PY, PZ;
int MX, MY, MZ;
int Dist, Roam;
Roam = 1024;
while (1)
{
//Get player location
Thing_ChangeTID(0, 255);
PX = GetActorX(255)/65536;
PY = GetActorY(255)/65536;
PZ = GetActorZ(255)/65536;
//Get monoceros location
MX = GetActorX(304)/65536;
MY = GetActorY(304)/65536;
MZ = GetActorZ(304)/65536;
Dist = ((PX - MX)^2 + (PY - MY)^2 + (PZ - MZ)^2)^(1/2);
print (d:Dist);//display distance test
if (Dist > Roam){ACS_Execute(53, 0);}//Respawns Monoceros near player
delay (const:35);
}
}