local ammo = script.Parent:WaitForChild('Ammo') local storedammo = script.Parent:WaitForChild('StoredAmmo') sling = script.Parent:WaitForChild('Slingshot') function Reload() if ammo.Value == 0 and storedammo.Value > 0 then ammo.Value = ammo.Value + 1 storedammo.Value = storedammo.Value - 1 elseif storedammo.Value == 0 and ammo.Value == 0 then print('Out of Ammo!') ammo.Value = ammo.Value end end function Check() if ammo.Value == 0 and storedammo.Value == 0 then sling.Disabled = true elseif ammo.Value > 0 or storedammo > 0 then sling.Disabled = false end end script.Parent.Equipped:connect(Reload) script.Parent.Equipped:connect(Check)
it doesn't lower the Ammo to 0 after it's been thrown... (I have it in another Script) and so u can still Throw as much as u want, plz help!
local ammo = script.Parent:WaitForChild('Ammo') local storedammo = script.Parent:WaitForChild('StoredAmmo') sling = script.Parent:WaitForChild('Slingshot') function Reload() if ammo.Value == 0 and storedammo.Value > 0 then ammo.Value = ammo.Value + 1 storedammo.Value = storedammo.Value - 1 sling.Disabled = false elseif storedammo.Value == 0 and ammo.Value == 0 then print('Out of Ammo!') sling.Disabled = true end end script.Parent.Equipped:connect(Reload)
I believe this should help you.
What I did was removed the check function and put it inside the reload function. What was happening is when it was equipt.. It would only check the once if they had ammo.. While if you put it along with the reload.. it will work every time they try to reload..