I am trying to make it so when a player touches a part, it will make a sound. But when touched again, the sound doesn't play. How do I fix this?
Here's the Script I used:
local debounce = false
function onTouched(hit)
if debounce == true then return end
debounce = true
script.Parent.Music:play()
end
debounce = false
wait (2)
script.Parent.Touched:connect(onTouched)

1 comment
@deerdharok Thanks so much, this really helped.