I have some code that allows the weapon to swap between the weapons they have using the Q input. I also have an ammo system in which every weapon has a set amount of ammo (sniper with 5, assault rifle with 30, etc) and when you run out you press space to reload.
However, putting them together has me a little confused as I am not sure how to get it so when you switch, it keeps the ammo you had on that weapon. At the moment, everything you switch, it resets to the default max.
The first two images are my ammo code and the latter is my switching weapons. Any help would be greatly appreciated!