i was spam clicking the gun and i realized it shoots faster.
my code is here:
Mouse.Button1Down:Connect(function()
if CurrentBooleans.Equipped and not CurrentBooleans.AimCooldown and CurrentBooleans.CanShoot and not CurrentBooleans.AutoShooting and not SettingModule.Burst and SettingModule.Auto and CurrentBooleans.ActuallyEquipped and CurrentBooleans.Aiming and not CurrentBooleans.Reloading and Tool:GetAttribute("Ammo") > 0 then
CurrentBooleans.AutoShooting = true
while CurrentBooleans.AutoShooting and task.wait(SettingModule.FireRate) do
Mouse.Button1Up:Connect(function()
CurrentBooleans.AutoShooting = false
end)
Network:FireServer("Fire"..NetworkKeys:FindFirstChild(Player.Name).ID.Value)
if SettingModule.GunFiringBlurEnabled then
Thread:Spawn(function()
local Blur = game.Lighting:FindFirstChild("GunBlur")
if Blur then
Blur.Enabled = true
Thread:Wait(0.28)
Blur.Enabled = false
end
end)
end
Thread:Spawn(RecoilCamera)
Fire(Mouse.Hit.p)
CurrentAnimTable.FireAnimation:Play()
Tool.Server.ChangeAmmoAndMag:FireServer(Tool:GetAttribute("Ammo") - 1, Tool:GetAttribute("Mag"))
CreateShell()
end
end
local Debounce = false
local DebounceDelay = 1
while true do
if not Debounce then
Debounce = true
-- Code
task.wait(DebounceDelay)
Debounce = false
end
end
Mouse.Button1Down:Connect(function()
if CurrentBooleans.Equipped and not CurrentBooleans.AimCooldown and CurrentBooleans.CanShoot and not CurrentBooleans.AutoShooting and not SettingModule.Burst and SettingModule.Auto and CurrentBooleans.ActuallyEquipped and CurrentBooleans.Aiming and not CurrentBooleans.Reloading and Tool:GetAttribute("Ammo") > 0 then
CurrentBooleans.AutoShooting = true
while true do
if not CurrentBooleans.AutoShooting then
CurrentBooleans.AutoShooting = true
Network:FireServer("Fire"..NetworkKeys:FindFirstChild(Player.Name).ID.Value)
if SettingModule.GunFiringBlurEnabled then
Thread:Spawn(function()
local Blur = game.Lighting:FindFirstChild("GunBlur")
if Blur then
Blur.Enabled = true
Thread:Wait(0.28)
Blur.Enabled = false
end
end)
end
Thread:Spawn(RecoilCamera)
Fire(Mouse.Hit.p)
CurrentAnimTable.FireAnimation:Play()
Tool.Server.ChangeAmmoAndMag:FireServer(Tool:GetAttribute("Ammo") - 1, Tool:GetAttribute("Mag"))
CreateShell()
task.wait(SettingModule.FireRate)
CurrentBooleans.AutoShooting = false
end
end
end
Sorry for not explaining it in every minute detail, but you’re supposed to have the debounce affect the Mouse.Button1Down event and not the while loop. Also not including your tables such as CurrentBooleans and Thread can make your code unreadable sometimes.