Ammo disapearing

I have code set up to save ammo to file and load ammo to file what works perfectly well, I simply make calls to get the ammo and save that value into a table that is then written and never again used till next time it saves.

But for some reason every so often when the player dies they lose ALL ammo, I was wondering if there was an issue with this or a way to prevent this because after checking my code a million times I have concluded it isn’t my code what I can see.

I also checked if it occurs in my PlayerDeath hook but the ammo disappears before it even enters that hook.

Thank you, any help is appreciated.

Still, it’d be great if you could post the code, it might help us to find out what’s causing the problem.

Try giving ammo a second after respawning instead of instant.