Here’s what I would do, in order (you may have done some of these things already):
1/ Check if the code is actually being executed (you can add a print for that).
2/ Check if weaponNumber has a correct value.
3/ Check if ammo is not equal to 0 (the code may work but adding 0 doesn’t do anything).
4/ Check if you’re changing the correct dictionary (could be a duplicated version of another one).
You’re not, don’t worry, everybody does mistakes like this
Just remember to always look for the most basic things first with simple prints, will same you some headaches with debugging your code.