local m=settings.DisplayMuteButton local n if m then n=script.MuteButtonGui:clone()end script.MuteButtonGui:Destroy()local w=true function SetButtonStyle(m)m.Text="\077\117\115\105\099\058 "..(w and"\079\078"or"\079\070\070")m.Style=w and Enum.ButtonStyle.RobloxRoundDefaultButton or Enum.ButtonStyle.RobloxRoundDropdownButton m.TextColor3=w and Color3.new(1,1,1)or Color3.new(.2,.2,.23)end function CreateButton()local m=n:clone()local L=m.Button L.Visible=true SetButtonStyle(L)L.MouseButton1Click:connect(function()w=not w local m=script:FindFirstChild("\066\071\077")if m then m.Volume=w and m.OriginalVolume.Value or 0 end SetButtonStyle(L)end)m.Parent=plr:WaitForChild("\080\108\097\121\101\114\071\117\105")end function CharInit()char=plr.Character torso=char:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if m 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("HumanoidRootPart")
	if canmute then CreateButton() end
end

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