How to keep the lua chat open but disable the chat icon?

So i’m trying to create a lua version of the old topbar and leaderboard and that includes
recreating the buttons functionality, that includes creating a Enable-Disable button for the chat.

Searching for a solution i didn’t find anything related to my question i tried to search the developer hub for a possible solution but all that apeared was just a blank page.

I tried other solution like searching on google or searching on the core scripts or the chat scripts but i didn’t find anything.

1 Like

Not sure if this helps - but here’s the Documentation on Lua’s Chat System

The Closest Than I Can Find Is ChatOnWithTopBarOff
But Thats for enabling the chat Window While Topbar is off.
I Don’t disable the topbar i disable the core scripts chat icon.

This might help

ChatBar API

“SetEnabled” sets whether the chat bar is enabled.

yea but i wand to toggle he visibility of the whole window.

ok so, for people than try to figgure out how to do this i found out than in the ChatMain module theres a function called ToggleVisibility(). all than you have to do is require that module though your script and you are done heres an example

-- Get The Module
local ChatMain = require(game.Players.LocalPlayer.PlayerScripts.ChatScript:WaitForChild("ChatMain"))

ChatMain:ToggleVisibility() -- This Function Toggles the chat window like the core gui button does
2 Likes