(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 y=require(U)y.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 if IconController.mimicCoreGui then IconController.previousTopbarEnabled=q if IconController.controllerModeEnabled then IconController.setTopbarEnabled(false,false)else IconController.setTopbarEnabled(q,false)end end IconController.updateTopbar()end)local M=checkTopbarEnabled()if not M and not IconController.mimicCoreGui then M=true end IconController.setTopbarEnabled(M,false)end))()

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
		if IconController.mimicCoreGui then
			IconController.previousTopbarEnabled = topbarEnabled
			if IconController.controllerModeEnabled then
				IconController.setTopbarEnabled(false,false)
			else
				IconController.setTopbarEnabled(topbarEnabled,false)
			end
		end
		IconController.updateTopbar()
	end)
	local makeVisible = checkTopbarEnabled()
	if not makeVisible and not IconController.mimicCoreGui then
		makeVisible = true
	end
	IconController.setTopbarEnabled(makeVisible, false)
end)()
