I have found a script that triggered the part and play a sound. But the sound interrupts itself if a humanoid moves around in the said part.
How do I get it so the part picks up a touch once and stops playing the sound after the humanoid leaves the selected area?
I would also like it if the sound did not interrupt itself if another humanoid were to also step in it, I want it to continue the sound until its cleared of any humanoids.
Im not sure how to fix it myself but heres what I got...
local sound = Instance.new("Sound", Workspace)
sound.Pitch = 1
sound.SoundId = "rbxassetid://889506820"
sound.Volume = .5
sound.Looped = true
script.Parent.Touched:connect(function()
sound:play()
end)
Needs fixed: Only pick up one humanoid touch. Not interrupt itself if humanoid moves around/another humanoid enters.
Can anyone help me figure out what I need to add to it?

2 comments
TouchEnded is not reliable
@TTChaos what else is there?