Ok let me explain my problem. So,im attempting to make a RP gun that i wanna use for my game,and i'm stuck at the reloading part.
Once the bullet value reaches 0,the gun reloads with the need of pressing R But during that reload,if i click a few times,the ammo gets lowered after the reload
(Let's say the reload is 3 seconds,and the magazine has 15 bullets,if i click 5 times in 3 seconds,i will lose 5 bullets after the reload,and the muzzle flash nor sound plays)
(I commented some of the anim parts as i still dont have an anim for these parts)
game.ReplicatedStorage.Shoot.OnServerEvent:Connect(function(player) -- Event thingy if not debounce then Bullets = Bullets -1 -- Takes away 1 bullet after every shot print(Bullets) Shoot:Play() -- Shooting Sound --local animTrack = Humanoid:LoadAnimation(Fire) --animTrack:Play() -- Muzzle Flash FlashGui.Enabled = true wait(0.1) FlashGui.Enabled = false end debounce = true wait(1) debounce = false -- Debounce1 -- Reload if Bullets <1 then script.Disabled = true script.Parent.Reload:Play() --local animtrack = Humanoid:LoadAnimation(ReloadAnim) --animTrack:Play() wait(1.7) Bullets = 15 script.Disabled = false end end)
Anyone know how to fix this? I'll explain better if you want me to.