I'm making a dynamite tool, but for some reason the debounce doesn't work and you can spam click to spawn more dynamite. Any fixes?
local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local Debounce = true
Tool.Activated:Connect(function()
if Debounce == true then
PlantBomb()
Debounce = false
wait(3)
Debounce = true
end
end)
function PlantBomb()
local Bomb = Handle:Clone()
Bomb.Parent = workspace
Bomb.CanCollide = true
Bomb.Anchored = false
Bomb.Transparency = 0
wait(3)
local Boom = Instance.new("Explosion")
Boom.Parent = workspace
Boom.Position = Bomb.Position
Boom.BlastRadius = 16
Bomb:Destroy()
end
