Toggle the Chat Menu when the chat's topbar icon is disabled without forking

Is it possible at all to toggle the default chat menu on and off, without forking the chat scripts, when the chat’s core gui is disabled?
i.e. game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)

As some context, I’m looking to re-create the newly proposed topbar, whilst maintaining full control over the design and functionality of these icons (excluding the Roblox menu icon).

I’ve attempted to use the SetCore method, although this doesn’t appear to work when the chat’s core gui is disabled:

game:GetService("StarterGui"):SetCore("ChatActive", true)
1 Like

SetCore has a function called CoreGuiChatConnections which you can use to control more aspects of the chat, such as firing Chatted or controlling the icon’s unread badge. It has a ToggleVisibility event which should be able to do what you’re asking for.

(dev hub has an example code for that SetCore at the very bottom of the page)

3 Likes

The page can be confusing in parts, although I believe I’ve setup a coded example correctly…

local targetName = "ChatWindow"
local name = "ToggleVisibility"
local signal = Instance.new("BindableEvent")
signal.Name = targetName.."_"..name
signal.Parent = script

game:GetService("StarterGui"):SetCore("CoreGuiChatConnections", {
	[targetName] = {
		[name] = signal,
	};
})

while true do
	wait(1)
	signal:Fire(true)
	wait(1)
	signal:Fire(false)
end

I’m running this in a LocalScript and tried both ToggleVisibility and SetVisible although nothing appears to happen. Any thoughts on correcting this?

1 Like

This code works fine for me in an actual game (not in studio):

game.StarterGui:SetCoreGuiEnabled("Chat", false)
ChatConnections.ChatWindow.VisibilityStateChanged:Fire(true)

image

You might need to reconnect chat bar events


Edit: for any future lurkers with a similar problem, we’ve come to a better solution in PMs with the OP:

game.StarterGui:SetCoreGuiEnabled("Chat", false)
local ChatMain = require(game.Players.LocalPlayer.PlayerScripts.ChatScript.ChatMain)
ChatMain.CoreGuiEnabled:fire(true)
ChatMain:SetVisible(true)
4 Likes