I know this is a simple thing, but my brain is having a slight meltdown. Anyways, I’m working on a weapon, and I’m trying to get it to reload with ammo. When the ammo get’s to zero, it reloads back to max ammo. The problem is I want to be able to show that the ammo is ‘0’ for a brief duration before reloading. Currently, when the ammo reaches 0, it reloads back to max ammo, and you can’t tell it’s at 0.
What happens is: Ammo gets to zero, then goes to 5. What I want is ammo gets to 0, pause for a brief duration, maybe reloading gui & sound may play, and then goes to max ammo.
Any help would be much appreciated.
ReloadGui.Text = "Ammo: ".. MaxAmmo local debounce = true function Reload() Ammo.Value = Ammo.Value - 1 if Ammo.Value == 0 then print("reloading") Ammo.Value = MaxAmmo end end Tool.Activated:Connect(function() if debounce then debounce = false Reload() ReloadGui.Text = "Ammo: ".. Ammo.Value print(Ammo.Value) wait(5) debounce = true end end)