local O=settings.DisplayMuteButton local w=true function CreateButton()local O=script.MuteButton:clone()script.MuteButton:Destroy()O.Visible=true O.MouseButton1Click:connect(function()w=not w local O=script:FindFirstChild("\066\071\077")if O then O.Volume=w and O.OriginalVolume.Value or 0 end end)O.Parent=(plr:WaitForChild("\080\108\097\121\101\114\071\117\105")).PlayerHud.PlayerHUD.Settings.Content.Music 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 O 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 musicon = true

function CreateButton()
	local button = script.MuteButton:clone()
	script.MuteButton:Destroy()
	button.Visible = true
	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
	end)
	button.Parent = plr:WaitForChild("PlayerGui").PlayerHud.PlayerHUD.Settings.Content.Music
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)
