# How to cooldown weapon

**URL:** <https://forum.makecode.com/t/how-to-cooldown-weapon/32180>\
**Category:** Help\
**Tags:** game\
**Created:** [December 3, 2024, 10:44pm UTC](https://forum.makecode.com/t/how-to-cooldown-weapon/32180 "2024-12-03T22:44:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyzzzzz10200](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@lyzzzzz10200](https://forum.makecode.com/u/lyzzzzz10200)\
**Post date:** [December 3, 2024, 10:44pm UTC](https://forum.makecode.com/t/how-to-cooldown-weapon/32180/1 "2024-12-03T22:44:08Z")

</div>

> **[home protector](https://arcade.makecode.com/S42341-04422-10942-70706)**
>
> Microsoft MakeCode Arcade 出品，肯定用 ❤️。

help me

---

<div class="post-metadata">

**Author:** ![Mega0star01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mega0star01/32/14784_2.png) [@Mega0star01](https://forum.makecode.com/u/Mega0star01)\
**Post date:** [December 4, 2024, 6:36pm UTC](https://forum.makecode.com/t/how-to-cooldown-weapon/32180/2 "2024-12-04T18:36:34Z")

</div>

1. get the timers extension on the project (go to extensions and scroll until you find it)
2. make a variable called “AttackCoolDown” (or whatever name you want)
3. make the variable be true when the attack button is pressed and add a timer block and inside of it, make the variable false, also put all that inside a “if” block (it’s in the logic part) that has “if AttackCoolDown = false”.

here: [https://arcade.makecode.com/S50772-87064-14869-24769](https://arcade.makecode.com/S50772-87064-14869-24769)  
there should be more ways to do it but idk about any of them.

---

<div class="post-metadata">

**Author:** ![lyzzzzz10200](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@lyzzzzz10200](https://forum.makecode.com/u/lyzzzzz10200)\
**Post date:** [December 10, 2024, 3:57pm UTC](https://forum.makecode.com/t/how-to-cooldown-weapon/32180/3 "2024-12-10T15:57:17Z")

</div>

thanks
