# How do I make different guns make different damage?

**URL:** <https://forum.makecode.com/t/how-do-i-make-different-guns-make-different-damage/31113>\
**Category:** Help\
**Tags:** game\
**Created:** [October 10, 2024, 9:17pm UTC](https://forum.makecode.com/t/how-do-i-make-different-guns-make-different-damage/31113 "2024-10-10T21:17:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigmatoilet321](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sigmatoilet321](https://forum.makecode.com/u/sigmatoilet321)\
**Post date:** [October 10, 2024, 9:17pm UTC](https://forum.makecode.com/t/how-do-i-make-different-guns-make-different-damage/31113/1 "2024-10-10T21:17:53Z")

</div>

What I mean is that when the player reaches 100 points, he would be able to choose between two guns, and I want it to do different damage.  
For example: Normal zombie HP: 50  
Pistol damage: 10hp  
SMG damage: 20hp  
Sniper damage: 50hp  
I also want to add ammo to each gun, can someone help?

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [October 11, 2024, 4:11am UTC](https://forum.makecode.com/t/how-do-i-make-different-guns-make-different-damage/31113/2 "2024-10-11T04:11:31Z")

</div>

Use variables and if statements to determine which weapon is being used and how much damage it deals with.  
Please take a look at the example project:

> **[Weapon-Damage-Test](https://arcade.makecode.com/85352-32383-49314-04187)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Inspect the code, and you will see.

> ****
>
> Wut da hail is that username bro 💀

---

<div class="post-metadata">

**Author:** ![sigmatoilet321](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sigmatoilet321](https://forum.makecode.com/u/sigmatoilet321)\
**Post date:** [October 17, 2024, 4:45pm UTC](https://forum.makecode.com/t/how-do-i-make-different-guns-make-different-damage/31113/3 "2024-10-17T16:45:25Z")

</div>

Alright, I got it.  
Now all I need is the player to reload when the magazine gets empty, configurate the fire rate for every gun and just put rarity on guns (Like lower chances to get a gun that does lots of damage on the shops)

---

<div class="post-metadata">

**Author:** ![sigmatoilet321](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sigmatoilet321](https://forum.makecode.com/u/sigmatoilet321)\
**Post date:** [October 17, 2024, 4:46pm UTC](https://forum.makecode.com/t/how-do-i-make-different-guns-make-different-damage/31113/4 "2024-10-17T16:46:38Z")

</div>

> **[Car race](https://arcade.makecode.com/S24164-58660-56572-15611)**
>
> Hecho con ❤️ en Microsoft MakeCode Arcade.

Here is the link of my game, I want it to spawn new enemies depending on the level, and all of the ammo, fire rate and stuff.
