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
** You are now Level 2! **