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

Audio still plays after being removed?

Asked by 9 years ago

I'm using an OnTouched script to play a sound. The problem is, once the model the sound is located in is removed, it continues to play. I need for the sound to stop playing once removed. No, PlayOnRemove is not set to true. Can anybody help with this? Here's my code...

1Sound = script.Parent.Sound
2active = false
3function onTouched(hit)
4    if active == false then
5        Sound:Resume()
6        active = true
7    end
8end
9connection = script.Parent.Touched:connect(onTouched)
0
Not sure if this would work, But instead of using Sound:Resume() try using Sound:Play() and Sound:Stop(). KordGamer 155 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

You have to loop it for god knows why.

Ad

Answer this question