I have some music with a script like this:
local sound1 = 949583914 local sound2 = 918984470 local sound3 = 390846973 local music=script.Parent while true do wait() music.SoundId="rbxassetid://"..sound1 music:Play() music.Ended:wait() wait() music.SoundId="rbxassetid://"..sound2 music:Play() music.Ended:wait() wait() music.SoundId="rbxassetid://"..sound3 music:Play() music.Ended:wait() wait() end
And I tried doing this:
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.Parent.Parent.Music.Volume = 0 end)
I don't know what I did wrong. You might not even be able to change the volume like that. I need it to be fully local too.
local Button = script.Parent -- Or where the button is local Music = script.Parent.Parent:WaitForChild('Music') -- Or where the music is Button.MouseButton1Click:connect(function() Music.Playing = not Music.Playing -- If playing is true then it makes playing false and reversed end)
Should explain itself, if you don't understand it, just ask :)
local Button = script.Parent Music = script.Parent.Parent:WaitForChild("Music") Button.MouseButton1Down:Connect(function() if Music.Playing then -- If the music is playing... Music.Playing = not Music.Playing -- Or Music:Pause() end if not Music.Playing then -- If the music is not playing... Music.Playing = true -- Keep playing it end end)
Try that.