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)

1 comment
Ok, can you explain why you're indexing a variable?