My script stops working when I add a debounce too it why?
Thanks in advance.
local Part = workspace:WaitForChild("Breakable_Glass")
local Delay = workspace.Breakable_Glass:WaitForChild("DelayOfSpawnAndDeb")
local Particle = workspace:WaitForChild("Breakable_Glass").GlassShatter
local shatter = game.ReplicatedStorage.starter:WaitForChild("Shatter")
local sound = Part.Sound
local running = false
Part.Touched:Connect(function(hit)
if not running then running = true
if hit.Parent:FindFirstChild("LeftFoot") or
hit.Parent:FindFirstChild("RightFoot") then
hit.Parent:FindFirstChild("AnimateCoins").Disabled = false
Particle.Enabled = true
wait(0.2)
Particle.Enabled = false
Part.Parent = game.ReplicatedStorage
shatter.Parent = workspace.Glass_Shatters
shatter.Anchored = true
sound:Play()
shatter.Parent = game.ReplicatedStorage:WaitForChild("Glass")
wait(5)
running = false
else
end
end
end)

2 comments
da debounce is too long
Buti changed it and still dosen't work