# Weapons :)

**URL:** <https://forum.kirupa.com/t/weapons/47362>\
**Category:** programming\
**Created:** [April 2, 2004, 11:47pm UTC](https://forum.kirupa.com/t/weapons/47362 "2004-04-02T23:47:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 2, 2004, 11:47pm UTC](https://forum.kirupa.com/t/weapons/47362/1 "2004-04-02T23:47:57Z")

</div>

alright i have a question. im creating a sidescroller game. and i took a tutorial at flash kit. for shooting and stuff like that here is the script

in gun…///////

onClipEvent (load) {  
moveSpeed = 10;  
\_root.bullet.\_visible = false;  
laserCounter = 1;  
}  
onClipEvent (enterFrame) {  
if(Key.isDown(Key.SPACE)){  
laserCounter++;  
\_root.laser.duplicateMovieClip(“laser”+1, laserCounter);  
\_root[“laser”+laserCounter].\_visible = true;  
\_root.ammo = \_root.ammo-1;  
}  
if (Key.isDown(Key.RIGHT)) {  
this.\_x += moveSpeed;  
} else if (Key.isDown(Key.LEFT)) {  
this.\_x -= moveSpeed;  
}  
if (Key.isDown(Key.DOWN)) {  
this.\_y += moveSpeed;  
} else if (Key.isDown(Key.UP)) {  
this.\_y -= moveSpeed;  
}  
}

in bullet…////

onClipEvent (load) {

laserMoveSpeed=20;  
this.\_x=\_root.mgun.\_x+90;  
this.\_y=\_root.mgun.\_y;

}

onClipEvent (enterFrame) {

this.\_x+=laserMoveSpeed;  
if (this.\_x\>550){  
this.removeMovieClip();  
}

}

now here is the real problem i want to make it so only one bullet can come at a time. because now it just keeps coming out. so could someone lead me in the right direction. like to a tutorial on a website. ot just teach me how on the forums

thanks in advance:)
