Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Audio still plays after being removed?

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

Sound = script.Parent.Sound
active = false
function onTouched(hit)
	if active == false then
		Sound:Resume()
		active = true
	end
end
connection = script.Parent.Touched:connect(onTouched)

1 comment

0

Not sure if this would work, But instead of using Sound:Resume() try using Sound:Play() and Sound:Stop().

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.