local T=settings.DisplayMuteButton local j if T then j=script.MuteButtonGui:clone()end script.MuteButtonGui:Destroy()local y=true function SetButtonStyle(T)T.Text="\077\117\115\105\099\058 "..(y and"\079\078"or"\079\070\070")T.Style=y and Enum.ButtonStyle.RobloxRoundDefaultButton or Enum.ButtonStyle.RobloxRoundDropdownButton T.TextColor3=y and Color3.new(1,1,1)or Color3.new(.2,.2,.23)end function CreateButton()local T=j:clone()local Q=T.Button Q.Visible=true SetButtonStyle(Q)Q.MouseButton1Click:connect(function()y=not y local T=script:FindFirstChild("\066\071\077")if T then T.Volume=y and T.OriginalVolume.Value or 0 end SetButtonStyle(Q)end)T.Parent=plr:WaitForChild("\080\108\097\121\101\114\071\117\105")end function CharInit()char=plr.Character torso=char:WaitForChild("\084\111\114\115\111")if T then CreateButton()end end if plr.Character and plr.Character.Parent~=nil then CharInit()end plr.CharacterAdded:connect(function()CharInit()end)

local canmute = settings.DisplayMuteButton
local clonegui
if canmute then
	clonegui = script.MuteButtonGui:clone()
end
script.MuteButtonGui:Destroy()

local musicon = true

function SetButtonStyle(button)
	button.Text = "Music: ".. (musicon and "ON" or "OFF")
	button.Style = musicon and Enum.ButtonStyle.RobloxRoundDefaultButton or Enum.ButtonStyle.RobloxRoundDropdownButton
	button.TextColor3 = musicon and Color3.new(1,1,1) or Color3.new(.2,.2,.23)
end

function CreateButton()
	local gui = clonegui:clone()
	local button = gui.Button
	button.Visible = true
	SetButtonStyle(button)
	button.MouseButton1Click:connect(function()
		musicon = not musicon
		local bgm = script:FindFirstChild("BGM")
		if bgm then
			bgm.Volume = musicon and bgm.OriginalVolume.Value or 0
		end
		SetButtonStyle(button)
	end)
	gui.Parent = plr:WaitForChild("PlayerGui")
end

function CharInit()
	char = plr.Character
	torso = char:WaitForChild("Torso")
	if canmute then CreateButton() end
end

if plr.Character and plr.Character.Parent ~= nil then
	CharInit()
end
plr.CharacterAdded:connect(function()
	CharInit()
end)
