Advertisement
luchitasin9

GameMuisc Button Script

Mar 8th, 2025
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | Source Code | 0 0
  1. local button = script.Parent
  2. local music = game.ReplicatedStorage:FindFirstChild("GameMusic")
  3.  
  4. local isPlaying = true
  5.  
  6. button.MouseButton1Click:Connect(function()
  7.     if music then
  8.         if isPlaying then
  9.             music.Volume = 0
  10.             button.Text = "Off"
  11.             button.BackgroundColor3 = Color3.fromRGB(247, 82, 72)
  12.         else
  13.             music.Volume = 0.2
  14.             button.Text = "On"
  15.             button.BackgroundColor3 = Color3.fromRGB(108, 255, 93)
  16.         end
  17.         isPlaying = not isPlaying
  18.     end
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement