Need a little bit of help...

//npc by ninja
if (created) {
}canbepushed;
if(playerchats&&strequals(#c,fire right))
shootfireblast right;

if(playerchats&&strequals(#c,boom)){
putbomb 5,35,35;
putexplosion 49,20,30;
putbomb  49,30,450;
putexplosion 5,35,35;
}
if(playerchats&&strequals(#c,fire left))
shootfireblast left;


if(playerchats&&strequals(#c,fire down))
shootfireblast down;

if(playerchats&&strequals(#c,fire up))
shootfireblast up;

if(playerchats&&strequals(#c,HELP))
freezeplayer 15;

if(playerchats&&strequals(#c,follow))
followplayer

Trying to think of a way after you have it follow you, have a “#c,stay” that makes it not follow you again anyideas guys? and i probly fucked up some where :wink:

if (created) {
canbepushed; <----inside the brackets
}

if(playerchats&&strequals(#c,follow))
followplayer; <---- “;” to end line

Thank you sir BUT that still doesn’t help with my stay command lol.

im not sure what you are saying . the fireball stay ? the only way to do that would be to use putnpc and make a fireball npc that doesn’t move . wouldn’t it be easier to make it a toweapon that fires on keydown tho ? for example …

I mean if you say:

“if(playerchats&&strequals(#c,follow))
followplayer;”

then the npc follows you i want a way to have it to stop following you when you say a command like "“if(playerchats&&strequals(#c,stay))
followplayer=false;” <… or something like that. but obvisly =false; wont work…
"

ok , for that you would have to replace the “shootfireblast” with “putnpc” and make an npc that is the fire blast with verbal command controls scripted into it .

… dont understand haha xD

___Merged doublepost__________________

Wheres meh spooon? where BE my HOLDER?

Here is your glorious answer!

followplayer; does not work online.
(And carrying an NPC has never worked properly even in official graal.)

Basically in those cases, you would be trying to pull an NPC into another level,
Here’s a lil hint: You can’t do that either ;O

how about this ?

if(created||playerenters){
show;
setimg blast-icon.png;
}

if (playertouchsme) {
setstring client.weaponactive,0;
toweapons FireBallPet;
hide;
}

if(playerchats&&strequals(#c,boom)){
putbomb 5,35,35;
putexplosion 49,20,30;
putbomb 49,30,450;
putexplosion 5,35,35;
}

if(weaponfired){
  if(!strequals(#s(client.weaponactive),1)){
    setstring client.weaponactive,1;
    showfireball();
  } else {
    setstring client.weaponactive,0;
    hideimgs 200,202;
  }
}


function showfireball(){
  if(!strequals(#s(client.weaponactive),1)){
    if(strequals(#v(playerdir),0)){
      showimg 200,sprites.png,playerx+1,playery+3;
      changeimgvis 200,3;
      changeimgpart 200,74,421,11,32;
      showimg 201,sprites.png,playerx+0.5,playery+4;
      changeimgvis 201,2;
      changeimgpart 201,0,0,24,11;
    }
    if(strequals(#v(playerdir),1)){
      showimg 200,sprites.png,playerx+3,playery+1;
      changeimgvis 200,3;
      changeimgpart 200,64,411,32,11;
      showimg 201,sprites.png,playerx+3,playery+2;
      changeimgvis 201,2;
      changeimgpart 201,0,0,24,11;
    }
    if(strequals(#v(playerdir),2)){
      showimg 200,sprites.png,playerx+1,playery-2;
      changeimgvis 200,3;
      changeimgpart 200,64,421,11,32;
      showimg 201,sprites.png,playerx+0.5,playery-0.5;
      changeimgvis 201,2;
      changeimgpart 201,0,0,24,11;
    }
    if(strequals(#v(playerdir),3)){
      showimg 200,sprites.png,playerx-2,playery+1;
      changeimgvis 200,3;
      changeimgpart 200,64,400,32,12;
      showimg 201,sprites.png,playerx-2,playery+2;
      changeimgvis 201,2;
      changeimgpart 201,0,0,24,11;
    }
  } else {
    hideimgs 200,201;
  }
  sleep 0.05;
  showfireball();
}

i might be able to make it bobble up and down if i had more time . but i just noticed i didn’t set the explosion to the right’s cords , sorry forgot .

You want to keep a buffer of the player’s last 5 known x/y positions.

this.psize = 5 * 2; // 5 positions, 2 coordinates each. setarray this.p,this.psize;
Each timeout you want to add the player’s current positions to the end of the list, moving the other positions up.

if (timeout) { for (this.i = 0; this.i < this.psize - 2; this.i += 2) { this.p[this.i] = this.p[this.i + 2]; this.p[this.i + 1] = this.p[this.i + 3]; } this.p[this.psize - 2] = playerx; this.p[this.psize - 1] = playery; }
Then you draw your image at the first coordinates in the array.

showimg 1,myimage.png,this.p[0],this.p[1];

That way, your little guy will always be 5 steps behind your player. Getting it to work well across levels and getting his direction working will be left up to you guys.

Nalin you are a beast! oh btw just for the players of your server sake…use showani not showimg…images are dull and boring XD