Thread: hmmmm
View Single Post
  #9  
Old 09-26-2005, 11:43 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
formatted/compacted better:

NPC Code:

//NPC made By Excaliber
//edited by Torankusu

if (playerenters){
playermp +=100;
toweapons Lightning 2;
}


//#CLIENTSIDE

//Checking to see if the weapon should be fired when the
//left mouse button is clicked down or not.

if(isweapon){
if (strequals(#w,Lightning 2)){
if (weaponfired && playermp>4 || mousedown && playermp>4){
set shooting;
timeout=.05;
}
}
}

if (timeout){
if (shooting){
disabledefmovement;
showimg 300,dr-crosshairs.png,mousex-.5,mousey-.35;
}
if (shooting){
if (keypressed){
if (strequals(#p(1),a)){
unset shooting;
hideimg 300;
enabledefmovement;
setani idle,;
}
}
}
timeout=.05;
}


if (mousedown && leftmousebutton && shooting){
unset shooting;
playermp=playermp-5; //remember to do this serverside.
newx2 = mousex;
newy2 = mousey;
putexplosion2 3,4,mousex-.75,mousey-.75;

for(i=1;i<100;i=i+25){
changeimgpart 400,0,0,35,i;
sleep .05;
}
hideimg 400;

hideimg 300;
setani idle,;

enabledefmovement;
hideimg 302;
sleep 3;
hideimg 301;
}



It won't shoot lightning online, but it works fine offline.
__________________
torankusu's
Reply With Quote