PHP Code:
function onTimeOut()
{
canwarp();
canwarp2();
this.attacker = "Graal713758";
if ( client.task[3] == "halfway" )
{
hideimg(200);
if (thiso.smovement == "walk")
{
chat = this.attacker;
this.timer = 11;
if (this.to_check.x in |this.x-3,this.x+3| && this.to_check.y in |this.y-3,this.y+3|)
{
thiso.smovement = "idle";
setcharani("idle",NULL);
}
thiso.smovement = "walk";
chat = thiso.smovement;
if ( this.timer > 10 )
{
with ( findplayer ( this.attacker ) )
{
this.newDir = getdir( player.x - this.x, player.y - this.y );
}
}
this.to_check = findnearestplayer(this.x,this.y);
this.dir = this.newDir;
this.new_x = this.x + vecx(this.dir) * this.mov_speed;
this.new_y = this.y + vecy(this.dir) * this.mov_speed;
this.count--;
if (this.count > 0)
{
this.to_add_x = this.new_x + 1.5 + vecx(this.dir);
this.to_add_y = this.new_y + 2 + vecy(this.dir);
if (onwall(this.to_add_x,this.to_add_y))
{
this.dir = (this.dir+2)%4;
this.timer = 0;
} else
if (onwater(this.to_add_x,this.to_add_y))
{
setcharani("swim",NULL);
}else
{
setcharani("spawn_weapon9mm-walk","");
x = this.new_x;
y = this.new_y;
}
} else
{
this.count = int(random(10,40));
}
}
}
setTimer(0.05);
}