hello devform it’s me again, in my tactical attachment system the player has the ability to switch mags. the problem that i am facing is that when the mag is switched the ammo value resets
Sounds like the simplest solution is adding another key to the ammoValues table called ammo which represents the current ammo in that magazine. When loading that magazine, read from that key instead of the magCapacity key.
self.ammo[self.wepName] = values.ammoValues.ammo
Of course, when switching away from that magazine, you’ll also need to set that value. Dunno where that happens in your code, but it would look like the inverse operation:
A number would probably make more sense, but it’s your game so you might have some other data to plug in. Personally, I would use Attributes on the Tool instead of a ModuleScript altogether.