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 8 years ago
function Click()

    script.Parent.Clicky.Disabled = true
    wait(0.1)
    game.Workspace.KillerRadius.Script.Disabled= true
    wait(0.1)
    script.Parent.Sound.Script.Disabled = true
    wait(10)
    script.Parent.Clicky.Disabled = false
    wait(0.1)
    game.Workspace.KillerRadius.Script.Disabled = false
    wait(0.1)
    script.Parent.Sound.Script.Disabled = false

end

script.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