# Issues with gun shooting not working

**URL:** <https://forum.makecode.com/t/issues-with-gun-shooting-not-working/1693>\
**Category:** Arcade\
**Created:** [April 14, 2020, 4:26pm UTC](https://forum.makecode.com/t/issues-with-gun-shooting-not-working/1693 "2020-04-14T16:26:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blobiy](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Blobiy](https://forum.makecode.com/u/Blobiy)\
**Post date:** [April 14, 2020, 4:26pm UTC](https://forum.makecode.com/t/issues-with-gun-shooting-not-working/1693/1 "2020-04-14T16:26:39Z")

</div>

Hello,  
I have a feeling that it has to do with something like the buildup of “pause” but i’m not quite sure.  
heres the [LINK](https://makecode.com/_1hqTct9KHik6)  
if you press (a) (to shoot) then it should shoot. and if you press (b) then it reloads, but every once in a while it will reload and the just break and you cant shoot.

Thanks

- Blobiy

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [April 14, 2020, 4:49pm UTC](https://forum.makecode.com/t/issues-with-gun-shooting-not-working/1693/2 "2020-04-14T16:49:25Z")

</div>

Yep, you are completely correct about the cause; every time you press B it is queueing a button event and that event can’t run until the last one finishes. To work around it, you can use a “timer” instead of pause. In other words, instead of this code:

 ![Screen Shot 2020-04-14 at 9.42.40 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/949eb5c9e54d1ac995ab3290580f1562706fa2f0.png)

do something like this:

 ![Screen Shot 2020-04-14 at 9.45.35 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/bd7f4f403358062c7770fd937d6bf4ec366cb937.png)

I created a variable named “ReloadTimeEnd” and set it equal to the current running time PLUS the amount of time for the reload. Then, inside the on game update I keep checking the current time to see if it has passed when the reload should have ended

---

<div class="post-metadata">

**Author:** ![Blobiy](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Blobiy](https://forum.makecode.com/u/Blobiy)\
**Post date:** [April 14, 2020, 6:33pm UTC](https://forum.makecode.com/t/issues-with-gun-shooting-not-working/1693/3 "2020-04-14T18:33:07Z")

</div>

thanks, i thought it was divided and then saw that. thanks to much @richard!!
