How to get core chat button state?

Im creating a custom chat gui to fit my game style, not for bypassing roblox’s new age group system.
Roblox has this default core chat button on the top left which tells the state of the chat window if it is visible or not. I want to get the state of visibility to give the ability to toggle the visibility of my custom chat gui window and input bar but i have no idea how to.

2 Likes
local StarterGui = game:GetService("StarterGui")
StarterGui:GetCore("ChatActive")
local StarterGui = game:GetService("StarterGui")
local RunService = game:GetService("RunService")

local function chatActiveChanged(chatActive)
	print("Yo chat active changed",chatActive)
end

local lastChatActive
RunService.RenderStepped:Connect(function()
	local chatActive = StarterGui:GetCore("ChatActive")
	if chatActive == lastChatActive then
		return
	end
	lastChatActive = chatActive
	chatActiveChanged(chatActive)
end)
1 Like

Disable Core Chat and fully control your own

This is the cleanest approach if you want total control.

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)

Then:

Your custom chat button controls visibility
Your custom input bar controls focus
No desync with Roblox UI

This is how most polished games do it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.