This LocalScript is inside a ScreenGui: (1298214499 is the sound id)
local music = {"1298214499", "1298214499"}
local sound = script.Parent.BGM
local muted = false
while true do
for i = 1, #music do
sound.SoundId = "rbxassetid://"..music[i]
sound:Play()
wait(sound.TimeLength)
end
end
This LocalScript is inside a TextButton inside the ScreenGui the first LocalScript is in:
local sound = script.Parent.Parent.BGM
local muted = false
script.Parent.MouseButton1Click:Connect(function()
if muted then
sound:Resume()
muted= false
script.Parent.Text = "Mute Music"
else
sound:Pause()
muted = true
script.Parent.Text = "Unmute Music"
end
end)
here is the game : https://web.roblox.com/games/929825495/Dice-o-mathy-BETA?refPageId=b621b278-c670-4274-a0ac-41a7522d1def

1 comment
Do I put the RemoteEvent in ReplicatedStorage or the ScreenGui?