Why does my script stop working when i add a debounce? (Fixed by me)
Asked by
5 years ago Edited 5 years ago
My script stops working when I add a debounce too it why?
Thanks in advance.
01 | local Part = workspace:WaitForChild( "Breakable_Glass" ) |
02 | local Delay = workspace.Breakable_Glass:WaitForChild( "DelayOfSpawnAndDeb" ) |
03 | local Particle = workspace:WaitForChild( "Breakable_Glass" ).GlassShatter |
04 | local shatter = game.ReplicatedStorage.starter:WaitForChild( "Shatter" ) |
05 | local sound = Part.Sound |
10 | Part.Touched:Connect( function (hit) |
11 | if not running then running = true |
12 | if hit.Parent:FindFirstChild( "LeftFoot" ) or |
13 | hit.Parent:FindFirstChild( "RightFoot" ) then |
14 | hit.Parent:FindFirstChild( "AnimateCoins" ).Disabled = false |
15 | Particle.Enabled = true |
17 | Particle.Enabled = false |
18 | Part.Parent = game.ReplicatedStorage |
19 | shatter.Parent = workspace.Glass_Shatters |
20 | shatter.Anchored = true |
22 | shatter.Parent = game.ReplicatedStorage:WaitForChild( "Glass" ) |