(coroutine.wrap(function()local q=players.LocalPlayer.PlayerScripts:WaitForChild("\067\104\097\116\083\099\114\105\112\116",4)or(game:GetService("\067\104\097\116")):WaitForChild("\067\104\097\116\083\099\114\105\112\116",4)if not q then return end local U=q:FindFirstChild("\067\104\097\116\077\097\105\110")if not U then return end local Q=require(U)Q.CoreGuiEnabled:connect(function()local q=checkTopbarEnabled()if q==IconController.previousTopbarEnabled then IconController.updateTopbar()return"\083\101\116\067\111\114\101\071\117\105\069\110\097\098\108\101\100 \119\097\115 \099\097\108\108\101\100 \105\110\115\116\101\097\100 \111\102 \083\101\116\067\111\114\101"end IconController.previousTopbarEnabled=q if IconController.controllerModeEnabled then IconController.setTopbarEnabled(false,false)else IconController.setTopbarEnabled(q,false)end IconController.updateTopbar()end)IconController.setTopbarEnabled(checkTopbarEnabled(),false)end))()
-- Mimic the enabling of the topbar when StarterGui:SetCore("TopbarEnabled", state) is called
coroutine.wrap(function()
	local chatScript = players.LocalPlayer.PlayerScripts:WaitForChild("ChatScript", 4)
		or game:GetService("Chat"):WaitForChild("ChatScript", 4)
	if not chatScript then
		return
	end
	local chatMain = chatScript:FindFirstChild("ChatMain")
	if not chatMain then
		return
	end
	local ChatMain = require(chatMain)
	ChatMain.CoreGuiEnabled:connect(function()
		local topbarEnabled = checkTopbarEnabled()
		if topbarEnabled == IconController.previousTopbarEnabled then
			IconController.updateTopbar()
			return "SetCoreGuiEnabled was called instead of SetCore"
		end
		IconController.previousTopbarEnabled = topbarEnabled
		if IconController.controllerModeEnabled then
			IconController.setTopbarEnabled(false, false)
		else
			IconController.setTopbarEnabled(topbarEnabled, false)
		end
		IconController.updateTopbar()
	end)
	IconController.setTopbarEnabled(checkTopbarEnabled(), false)
end)()
