Not sure about the weapon script, but I found some errors in the gani script after trying a few things.
PHP Code:
//onCreated doesn't seem to work when you're putting ganis in player.attr[].
function onPlayerEnters() {
with (findimg(200)) { //There was a missing parenthesis here.
attachtoowner = true; //Follow the player.
emitter.delaymin = 0.01;
emitter.delaymax = 0.01;
emitter.nrofparticles = 1;
emitter.particle.image = "g4_animation_fire.gif";
emitter.particle.alpha = 0.99;
emitter.particle.lifetime = 0.5;
emitter.particle.speed = 10;
emitter.particle.spin = 2;
emitter.particle.red = 1;
emitter.particle.green = .4;
emitter.particle.blue = .4;
}
this.showtime=timevar2 + 2;
setTimer(0.05);
}
function onTimeout() {
//showimg(200); //What?
if(this.showtime > timevar2) {
this.fireangles= {-4.7,-3.1,-1.6,0};
//Doesn't do anything I think.
//x = player.x;
//y = player.y;
//Shorter version of the below.
findimg(200).emitter.particle.angle = this.fireangles[player.dir]+random(-.5,.5);
/*for(i=0;i<4;i++) {
if(player.dir == i) {
findimg(200).emitter.particle.angle = this.fireangles[i]+random(-.5,.5);
}*/
}
setTimer(0.05);
//} //Extra bracket?
}
Not sure why you're making it stop updating after 2 seconds, since onClearFire seems to be doing that just fine.