Ok i'm sorry i have been trying to avoid posting here because i have the feeling i am becoming annoying, but no one i talk to can figure this out!
NPC Code:
if (created) {
initialize();
}
if (timeout) {
message #v(this.hearts/2);
if (this.found==0) {
setcharani mold_idle,;
for (i=0;i<playerscount;i++) {
if (abs(players[i].x-x)<=20&&abs(players[i].y-y)<=20) {
this.found=1;
break;
}
}
}
if (this.found==1) {
if (abs(players[i].x-x)<=20&&abs(players[i].y-y)<=20) {
setcharani ekmold-move,;
tx=players[i].x - x;
ty=players[i].y - y;
dist= (tx*tx+ty*ty)^0.5;
nx= (tx/dist)*1.2;
ny= (ty/dist)*1.2;
move nx,ny,1.2,;
if (players[i].x in |x-3,x+3|&&players[i].y in |y-3,y+3|) {
setcharani ekmold-attack,;
with(players[i]) {
setani hurt,;
setstring client.hp,#v(strtofloat(#s(client.hp))-1);
};
timeout=1;
}
} else {
setcharani ekmold-idle,;
this.found=0;
timeout=.1
}
timeout=.4;
}
timeout=.4;
}
function initialize() {
this.hearts=6;
setcharani ekmold-idle,;
timeout=.4;
}
function checkdead() {
if (this.hearts<=0) {
with(getplayer(#p(2))) {
insertstring client.messages,0,You gained EXP;
setstring client.playerexp,#v(strtofloat(#s(client.playerexp ))+3);
if (strlen(#g)>1) {
setstring server.account,#a;
setstring server.guild,#g
}
}
for(i=0;i<allplayerscount;i++) {
with (allplayers[i]) {
if (strequals(#g,#s(server.guild))&&!strequals(#a,#s( server.account))) {
insertstring client.messages,0,You guild/party got you EXP;
setstring client.playerexp,#v(strtofloat(#s(client.playerexp ))+3);
}
}
}
timeout=0;
putexplosion 1,x,y;
hide;
sleep 30;
show;
initialize();
}
else {
setcharani mold_idle,;
timeout=.65
}
}
//PROBLEM AREA
if (actionprojectile) {
this.hearts-=strtofloat(#p(1))+1;
setcharani mold_idle,;
message #v(this.hearts/2);
checkdead();
sleep .5;
}
//
ok i have looked over it as have several NATs. See the if (actionprojectile)?
well it doesnt respond to that. it ignores it. Acts like i never added that flag. It is very weird. I have actually replaced it with simple things like playerchats and they work. So why doesnt this? It should work by all standards. It used to work before EK was hacked. but now it doesnt. Any help would be appreciated