I made a simple piece of code for an ammo system that I was making. This is the script that I made:
script.Parent.ammo.Value = script.Parent.ammo.Value - 1
For some reason, it won't subtract the value and I'm 1000% certain that I did type the code correctly. Is this some ROBLOX bug? Because no error outputs are showing up either.
When code doesn't seem to be running, there are a few things to check:
coroutine.resume(coroutine.create(function() --[[your code here]] end))
if you haven't had the coroutine wait
or otherwise yield yetprint(script.Parent.ammo:GetFullName())
might help, for instance. Printing its value before/after will confirm that the script is having the desired effect - perhaps a different script is undoing your efforts instead of this one not working.