Once again, doesn't work
Movement is messed up, he doesn't shoot, and you can still only hit him once. Any thoughts?
Here's what I have now:
PHP Code:
function onCreated()
{
showcharacter();
dir = 2;
setcharani("dr_baddy_spider",NULL);
setshape(1,32,32);
hearts = int(random(10,25));
onTimeout();
}
function onTimeout()
{
if(hearts>0)
{
if(this.walk==0)
{
setcharani("dr_baddy_spider_prep",NULL);
sleep(random(.5,1.5));
shootball();
setcharani("dr_baddy_spider_shoot",NULL);
this.walk=int(random(2,15));
}
else
{
this.walk--;
if(abs(x-player.x)>=abs(y-player.y))
{
if(player.x<x)
{
dir = 1;
}
if(player.x>=x)
{
dir = 3;
}
}
else if(abs(x-player.x)<abs(y-player.y))
{
if(player.y>y)
{
dir = 2;
}
if(playery<=y)
{
dir = 0;
}
}
if(player.x+.5<x)
{
if(!onwall(x-.2,y) && !onwall(x-.2,y+2))
{
x-=.2;
}
}
else if(player.x+.5>=x)
{
if(!onwall(x+2.2,y) && !onwall(x+2.2,y+2))
{
x+=.2;
}
}
if(player.y+1<y)
{
if(!onwall(x,y-.2) && !onwall(x+2,y-.2))
{
y-=.2;
}
}
else if(player.y+1>=y)
{
if(!onwall(x,y+.2) && !onwall(x+2,y+.2))
{
y+=.2;
}
}
}
}
else if(hearts<=0)
{
hearts = 0;
triggeraction(0,0,"serverside","-System","exp","secure",player.account,1);
setani(NULL,NULL);
sleep(random(7,20));
onCreated();
}
settimer(.1);
}
function onPlayertouchsme()
{
setani("hurt",NULL);
triggeraction(0,0,"serverside","-System","hurt","secure",1);
}
function onWa****()
{
setcharani("dr_baddy_spider_shoot",NULL);
}