Hello so i have this script:
local sound = script.Sound
function onTouched(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
wait(4)
sound:Play()
end
end
function onTouchEnded(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
sound:Stop()
end
end
script.Parent.Touched:Connect(onTouched)
script.Parent.TouchEnded:Connect(onTouchEnded)
and it works fine. but the problem is that when i move it sometimes stops playing. any help? region3 might be helpful but i don't want to make a new part. i want it to be existing and used for the script.
thanks!

2 comments
try capitalizing the f in "findFirstChild"
also, if it is a local script the touched event will not work