It is a local script and the Music.Value is a datastore inside a server script.
local player = game:GetService("Players").LocalPlayer local Hidden = player:WaitForChild("Hidden") local gui = script.Parent local Button = script.Parent:WaitForChild("BackFrame").TextButton Button.Activated:Connect(function() if player.Hidden.Music.Value == true then Button.Text = "Unmute" player.Hidden.Music.Value = false elseif player.Hidden.Music.Value == false then Button.Text = "Mute" player.Hidden.Music.Value = true end if player.Hidden.Music.Value == true then script.Parent.Parent.Sounds.SoundHover.Volume=0 end if player.Hidden.Music.Value == false then script.Parent.Parent.Sounds.SoundHover.Volume=1 end end)
If the audio just mutes if the buttons text is "Mute" then it is because the last two if statements are not needed and cause the error.
Also, at BoolValues an "elseif" is not needed, since there are only two ways of how it can be. (Really little timesaver ;) )
Here it is fixed:
local player = game:GetService("Players").LocalPlayer local Hidden = player:WaitForChild("Hidden") local gui = script.Parent local Button = script.Parent:WaitForChild("BackFrame").TextButton Button.Activated:Connect(function() if player.Hidden.Music.Value == true then Button.Text = "Unmute" player.Hidden.Music.Value = false script.Parent.Parent.Sounds.SoundHover.Volume=0 else Button.Text = "Mute" player.Hidden.Music.Value = true script.Parent.Parent.Sounds.SoundHover.Volume=1 end end)