name Exit
type none
offscreenkill 3000
anim idle
@script
void self = getlocalvar("self");
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
char Name = getentityproperty(self,"name");
float Tx1 = getentityproperty(P1, "x");
float Tz1 = getentityproperty(P1, "z");
float Tx2 = getentityproperty(P2, "x");
float Tz2 = getentityproperty(P2, "z");
float Disx1 = Tx1 - x;
float Disz1 = Tz1 - z;
float Disx2 = Tx2 - x;
float Disz2 = Tz2 - z;
if(Disz1 < 0){
Disz1 = -Disz1;
}
if(Disz2 < 0){
Disz2 = -Disz2;
}
if(frame >= 1){
if(Disx1 >= -20 && Disx1 <= 20 && Disz1 <= 10){
jumptobranch(Name, 1);
} else if(Disx2 >= -20 && Disx2 <= 20 && Disz2 <= 10){
jumptobranch(Name, 1);
}
}
@end_script
loop 1
delay 6
offset 30 70
frame DATA/chars/misc/direction/11.gif
frame DATA/chars/misc/direction/12.gif
frame DATA/chars/misc/direction/13.gif
frame DATA/chars/misc/direction/14.gif