Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local button = script.Parent
- local music = game.ReplicatedStorage:FindFirstChild("GameMusic")
- local isPlaying = true
- button.MouseButton1Click:Connect(function()
- if music then
- if isPlaying then
- music.Volume = 0
- button.Text = "Off"
- button.BackgroundColor3 = Color3.fromRGB(247, 82, 72)
- else
- music.Volume = 0.2
- button.Text = "On"
- button.BackgroundColor3 = Color3.fromRGB(108, 255, 93)
- end
- isPlaying = not isPlaying
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement