sorry to say but your code is the devil...
you have a lot of usless coding...
mabie try this
NPC Code:
if(playertouchsme)
toweapons Boost-up;
if(isweapon&&playerenters)
timeout=0.1;
if(weaponfired)
this.on=1-this.on;
if(timeout&&this.on==1){
for(this.i==0;this.i<4;this.i++) if(keydown(this.i))
if(!onwall(playerx+1.5+vecx(playerdir)*2,playery+1 .5+vecy(playerdir)*2)&&!onwater(playerx+1.5+vecx(p layerdir)*2,playery+1.5+vecy(playerdir)*2)){
playerx+=vecx(playerdir);
playery+=vecy(playerdir);
}
}
try that out... (the onwall and onwater code isn't the best but oh well)...