Starcon Firemines

Was trying to piece back together starcon firemines. Seems to have been successful (tested offline only).
In-Game NPC:

if (created) {
setimg missletarget.gif;
toweapons Starcon Firemines;
}
if (weaponfired) {
set armed;
putnpc ,fmines.txt,playerx-.5,playery;
}

fmines.txt:

if (created && armed) {
setimg missletarget.gif;
drawoverplayer;
dontblock; }
if (armed && keypressed && keydown2(70,true)) {
putexplosion2 2,5.5,x-1,y;
putexplosion2 2,5.5,x,y;
putexplosion2 2,5.5,x+1,y;
unset armed;
destroy;
}

Not sure if this would work online/on a server though. As-is, it would only operate locally, correct? Would not affect/hurt other players without adjustments?

A little more testing, there is an interesting issue with this. If a player fires the weapon multiple times before detonating the first one that was laid, the others will not detonate until you fire weapon again, and then the it detonates the second one laid, third one, so and so forth. Has to do with the flag ‘armed’ being unset after fmines.txt is finished. Seems there needs to be either some kind of control to only allow for one mine to be on the board or have it account for multiple ones laid and blow them too on the F key press. Tested with disableweapons after flag ‘armed’ set and then enableweapons after exploded, but that cuts use of sword as well. I’ll put up a demo of the issue a little later.

Worked with a little more and resolved the issue. To keep the player from spamming the board with unusable firemines, set a conditional between the (created && armed) and (armed && keypressed && keydown2(70,true)) statement to destroy the previous one on the board if the player presses ‘D’ again. Also fixed it up to make a more accurate explosion to the original.
updated fmines.txt:

if (created && armed) {
setimg missletarget.gif;
drawoverplayer;
dontblock; }
if (armed && keypressed && keydown2(68,true)) { //always something simple, am I right?
destroy;
}
if (armed && keypressed && keydown2(70,true)) {
putexplosion2 2,5.5,x-1,y;
putexplosion2 2,5.5,x,y;
putexplosion2 2,5.5,x+1,y;
putexplosion2 2,5.5,x,y-1;
putexplosion2 2,5.5,x,y;
putexplosion2 2,5.5,x,y+1;
unset armed;
destroy;
}

This is the original

GRAWP001
REALNAME STARCON FireMine
IMAGE starconexplo.png
SCRIPT
if (playertouchsme) {
  toweapons STARCON FireMine;
  playerbombs+=1;
}
if (weaponfired) {
  if (this.targetactive==0) {
    if (playerbombs>=5) {
      playerbombs-=5;
      this.targetactive=1;
      this.x=playerx;
      this.y=playery;
      showimg 0, starconexplo.mng, this.x, this.y;
    }
  } else {
    this.targetactive=0;
    putexplosion 5, this.x, this.y;
    putexplosion 4, this.x+1, this.y;
    putexplosion 4, this.x, this.y+1;
    putexplosion 4, this.x+1, this.y+1;
    putexplosion 4, this.x, this.y-1;
    putexplosion 4, this.x-1, this.y;
    putexplosion 4, this.x-1, this.y-1;
    hideimg 0;
  }
}
SCRIPTEND