Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I cannot stop sounds in my game. How would I go about this?

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)


1 answer

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)

4 comments

0

It didnt work

0

@Tetris, make sure that the script.Parent is something that is somewhere in the workspace. Both "t" and the script need to be parented by the same object

0

:Stop() does not exist, use :Pause()

This discussion is preserved as it was. New answers, comments, and votes are closed.