Advertisement
Joriangames

SoundButton

Jun 19th, 2020
9,007
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. --Variables
  2. local GoodSound = game.SoundService.GoodSound
  3. local play = false
  4.  
  5. --script
  6. script.Parent.MouseButton1Click:Connect(function()
  7.     if play then
  8.         GoodSound.Volume = 1                --volume from the music when it's on
  9.         play = false
  10.         script.Parent.Text = "Mute music" else  --you can change the text from the button here between ""
  11.         GoodSound.Volume = 0                    --volume from the music when it's off
  12.         play = true        
  13.         script.Parent.Text = "Play music"       --you can change the text from the button here between ""
  14.     end
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement