This is really confusing as I only need it to play Once, but whenever I collide, it replays the sound.
Here's What I have so far:
local Sound = script.Parent.Sound local Set = false function onTouched(hit) if Set == false then Sound:Play() elseif Set == true then Sound:Stop() wait(3) Sound:Stop() Set = true
Help is Greatly appreciated.
This assumes you have a part in workspace with this script inside it:
local Sound = script.Parent.Sound local Set = false script.Parent.Touched:Connect(function(part) if not Set then Set = true Sound:Play() wait(3) Sound:Stop() Set = false else Sound:Stop() Set = false end end)