I'm having trouble with a certain script. I don't know how to stop a sound from playing multiple times when you touch a brick. It keeps repeating and I have no answer for this.
This is the whole script v
local Part = script.Parent
local Sound1 = script.Parent.Sound1
Part.Touched:connect(function(hit)
local hum = hit.Parent:WaitForChild('Humanoid')
if hum then
while true do
Sound1:Play()
wait(1)
--wait(0.82800000000000007)
break
end
end
end)
p.s I'm new to scripting, so go easy on me.

3 comments
It appears you formatted this a bit wrong. Make sure you put your code in between the "~~~" lines.
Thank me by accepting my answer
Make sure you also aren't looping it! To stop this, disable it in Properties.