Ok so I have a sound block that plays music for an area of my game. I need it to stop when you enter the next area I tried scripting a block that stops all sounds and then it goes to the other sound brick and plays the music for that area. But the block thats stops the sound isn't working. I need to stop all the sounds.How would I go about this?
b = script.Parent t = script.Parent.Sound
function onTouch()
t:stop()
end
b.Touched:connect(onTouch)
You need to capitalize the word stop to fire the actual event
The code should look like this:
local b = script.Parent local t = script.Parent.Sound b.Touched:Connect(function() t:Stop() end)