#Mute button help

1 messages · Page 1 of 1 (latest)

fringe junco
#

so im tryna make a mute button but whenever i press the mute button nothing happens, here the script

local muteButton = muteGui:WaitForChild("Button")

local muteColor = muteButton.BackgroundColor
local muteColorText = muteButton.TextColor

local music = game.StarterPlayer.StarterCharacterScripts:WaitForChild("Music")

muteButton.MouseButton1Click:Connect(function()
    if music and muteButton.Text == "Music: On" then 
        print("Yea")
        music.Playing = false
        muteButton.BackgroundColor = Color3.new(255,255,255)
        muteButton.TextColor = Color3.new(0,0,0)
        muteButton.TextColor = "Music: OFF"
    end
end)

muteButton.MouseButton1Click:Connect(function()
    if music and muteButton.Text == "Music: OFF" then 
        music.Playing = false
        muteButton.BackgroundColor = muteColor
        muteButton.TextColor = muteColorText
        muteButton.TextColor = "Music: ON"
    end
end)```

ples help
fringe junco
#

oh wait

brisk rampartBOT
#

studio** You are now Level 2! **studio

fringe junco
#

it doesnt work

#

it doesnt even print anything

#

oh snap

#

i fixed i

gleaming scaffold
#

music:Stop()

surreal magnet
#
local Sound = -- Sound --
local Button = -- Button --


Button.MouseButton1Click:Connect(function()
    IsPlaying = not IsPlaying
    if IsPlaying  then
        Sound:Play() -- sound is playing
        -- here u put the stuff u wanna do when the sound is playing
    else
        Sound:Stop() -- sound not playing
        -- here u put the stuff u wanna do when the sound is not playing
    end
end)```