Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make sound stop when the parent brick is clicked?

Asked by 9 years ago
01function Click()
02 
03    script.Parent.Clicky.Disabled = true
04    wait(0.1)
05    game.Workspace.KillerRadius.Script.Disabled= true
06    wait(0.1)
07    script.Parent.Sound.Script.Disabled = true
08    wait(10)
09    script.Parent.Clicky.Disabled = false
10    wait(0.1)
11    game.Workspace.KillerRadius.Script.Disabled = false
12    wait(0.1)
13    script.Parent.Sound.Script.Disabled = false
14 
15end
16 
17script.Parent.ClickDetector.MouseClick:connect(Click)

When the brick is clicked, it will do those things. Now almost all of these work, except the sound bit. It doesn't stop. The sound is looped, and only lasts about 3 seconds, so there should be no problem stopping it within 3 seconds, yet it keeps going, and going. Any ideas? How could I fix this?

Answer this question