I am currently creating a gun script and there is two values; CurrentAmmo and MaxAmmo. I created this portion of the script:
mouse.Button1Down:Connect(function()
if enableMouse == true then
isFull = false
currentAmmo.Value = currentAmmo.Value - 1
print(currentAmmo.Value)
realFrame:TweenSize(UDim2.new(1,0,currentAmmo.Value / maxAmmo.Value),'In','Sine',.1)
game.StarterPlayer.Fire:Play()
if currentAmmo.Value <= 0 then
reload = true
gunSound.SoundId = emptyAmmoSound
backgroundFrame.TextLabel.Visible = true
realFrame.BackgroundColor3 = Color3.fromRGB(255,0,0)
currentAmmo.Value = 0
end
end
end)
However, the CurrentAmmo keeps going down until negative, despite the script telling it not to.
Any help please?

2 comments
Can you show an example please?
made an edit