# Need help controlling the amount of bullets

**URL:** <https://forum.kirupa.com/t/need-help-controlling-the-amount-of-bullets/81535>\
**Category:** Uncategorized\
**Created:** [March 3, 2005, 3:39am UTC](https://forum.kirupa.com/t/need-help-controlling-the-amount-of-bullets/81535 "2005-03-03T03:39:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![james69](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@james69](https://forum.kirupa.com/u/james69)\
**Post date:** [March 3, 2005, 3:39am UTC](https://forum.kirupa.com/t/need-help-controlling-the-amount-of-bullets/81535/1 "2005-03-03T03:39:31Z")

</div>

I cant figure out how decrease or control the amount of bullets in this actionscript when some click on the mouse, otherwise it is constant stream of bullets when a user clicks fast enough. If there is another script giving me the ability to shoot projectiles out of barrel that movies at a angle controlled by a cross air

Mouse.hide();  
var speed:Number = 10;  
var depth:Number = 1;  
var nose:Number = 95;  
\_root.onMouseMove = function() {  
updateAfterEvent();  
var xdiff:Number = \_root.\_xmouse-gun.\_x;  
var ydiff:Number = \_root.\_ymouse-gun.\_y;  
var angle:Number = Math.atan2(ydiff, xdiff);  
angle = angle_180/Math.PI;  
gun.\_rotation = angle;  
};  
\_root.onMouseDown = function() {  
var angle:Number = gun.\_rotation;  
angle = angle_Math.PI/180;  
++depth;  
var name:String = “projectile”+depth;  
var clip:MovieClip = \_root.attachMovie(“projectile”, name, depth);  
clip.\_x = gun.\_x+nose_Math.cos(angle);  
clip.\_y = gun.\_y+nose_Math.sin(angle);  
clip.xmov = speed_Math.cos(angle);  
clip.ymov = speed_Math.sin(angle);  
clip.onEnterFrame = function() {  
this.\_x += this.xmov;  
this.\_y += this.ymov;  
};  
};
