Hello, I am making a gun and I have a cooldown since its a rifle.. like M1 Garand. I also have another cooldown to prevent the player from shooting if he is lowering his weapon with an animation.
I have no idea why but my cooldowns wont work. It wont stop me from shooting but its a rifle so I need to have that small cooldown. Why wont this work?
canFire = true
gundisabled = true
--//-- SHOOTING --\\--
script.Parent.Equipped:Connect(function(Mouse)
script.Parent.TakeOut:Play()
if canFire == true then
if gundisabled == true then
Mouse.Button1Down:Connect(function()
FireSound:Play()
FlashPart.Material = "Neon"
FlashPart.Transparency = 0
wait(0.1)
FlashPart.Transparency = 1
canFire = false
script.Parent.Smoke.ParticleEmitter.Enabled = true
wait(3)
canFire = true
script.Parent.Smoke.ParticleEmitter.Enabled = false
end)
elseif gundisabled == false then
print("Gun Is Disabled")
elseif canFire == false then
print("Rifle Cooldown")
end
end
end)

2 comments
I edited my answer for you. After reading my answer I am sure you can figure this out. I am not going to just spoonfeed you.
Glad I could help!