okay, this is a script that I'm using, and it works, however when it's used around an npc baddie, it doesn't work, why yould this be happening? (baddies are both the pre-defined ones, and other ones made in similar fashions, which is most of the baddies on the sever, so i'd rather change this script)
NPC Code:
//NPC made By Excaliber
//#CLIENTSIDE
if(isweapon&&weaponfired&&playermp>4||isweapon&&mo usedown&&playermp>4){
disabledefmovement;
showimg 300,dr-crosshairs.png,mousex-.5,mousey-.35;
set shooting;
timeout=.05;
}
if(isweapon && shooting && timeout){
replaceani idle,grab;
setani grab,;
showimg 300,dr-crosshairs.png,mousex-.5,mousey-.35;
timeout=.05;
}
if(shooting&&keypressed&&strequals(#p(1),A)){
unset shooting;
hideimg 300;
enabledefmovement;
replaceani idle,idle;
setani idle,;
}
if(strequals(#w,Lightning 2)&&shooting && mousedown && leftmousebutton){
unset shooting;
playermp=playermp-5;
showimg 400,dr-lightning.png,mousex-.5,mousey-8;
newx2 = mousex;
newy2 = mousey;
for(i=1;i<100;i=i+25){
changeimgpart 400,0,0,35,i;
sleep .05;
}
putexplosion2 3,4,newx2-.75,newy2-.75;
hideimg 400;
hitobjects 2,mousex,mousey;
hitobjects 2,mousex-.25,mousey-.25;
hitobjects 2,mousex+.25,mousey-.25;
hitobjects 2,mousex-.25,mousey+.25;
hideimg 300;
timeout=.05;
replaceani idle,idle;
setani idle,;
enabledefmovement;
hideimg 302;
sleep 3;
hideimg 301;
}
if(timeout&&!shooting){
hideimg 300;
}