The issue is you don’t want the while loop to wait for this tween. If the while loop has to wait for this one tween it will stop detecting and hence not be responsive.
The solution is to create a “new script” or properly named thread that will do the waiting in the background. To do this you can use task.spawn or coroutine .wrap like so:
task.spawn(function()
sOFF.Completed:Wait()
script.Parent.SoundRegions[v.Name]:Stop()
end)
--coroutine
coroutine.wrap(function()
sOFF.Completed:Wait()
script.Parent.SoundRegions[v.Name]:Stop()
end)()--create coroutine function then execute it
A solution to zone detection which is more efficient as it only detects players and the hrp, instead of all the parts inside the zone.