Sorry if the question is stupid but I really don't know how to do it. Here is the code that I have:

local debounce = false
script.Parent.Touched:Connect(function()
if not debounce then
debounce = true
workspace.LobbyMusic:Play() --LobbyMusic is the name of the Sound
end
end)

and the other, which is the same:

local debounce = false
script.Parent.Touched:Connect(function()
if not debounce then
debounce = true
workspace.CrimsonMusic:Play() --CrimsonMusic is the name of the Sound
end
end)

When I touch the brick with the 2nd script, how do I stop the 1st script from running?

3 comments

0

You can just set a variable to the Lobby Music and in the second script when the touched event is hit just pause or stop the sound.

0

Okay thanks

0

Oh I was doing it wrong xD