So it all works, changes the Gui etc, but it doesn't do it smoothly. It just skips straight to 12, rather than waiting and changing it by 1 every 0.1 of a second. What is wrong with my code?
mouse.KeyDown:connect(function(key) local key = string.lower(key) if key == "r" then if ammo < 12 then repeat ammo = ammo + 1 clone.Ammo.Text = ammo.."/12" wait(0.1) until ammo == 12 end --end if ammo < 12 end --end if key == "r" end) --end keydown function
I can't think of why it might be skipping the rest, but try this code:
mouse.KeyDown:connect(function(key) local key = string.lower(key) if key == "r" then while ammo < 12 then ammo = ammo + 1 clone.Ammo.Text = ammo .. "/12" wait(0.1) -- One tenth of a second is a *very* short time. end end end)
Maybe your problem is just that it reloads so fast, you simply can't see 1 through 11?