Alternative ways of disabling the chat window while in-game

Hello!

As the title reflects, I’m creating a sort of “who dun it” type of game and I want to have the ability of switching the chats from bubble to classic from time to time.

Each player has a bool value called ChatHistory. When marked true, the I want the chat window to appear. When marked false, I want the chat window to disappear and just be the bar where you type.

local ChatService = game:GetService("Chat")
local players = game:GetService("Players")


for i, v in pairs (players:GetChildren()) do
	local Bool_ChatHistory = v.PlayerScripts:WaitForChild("ChatHistory")
	
	if Bool_ChatHistory.Value == true then
		ChatService.LoadDefaultChat = true
	else
		ChatService.LoadDefaultChat = false
	end
end

The problem is, I’ve ran into a roadblock where Roblox is even limiting my access.

Screen Shot 2022-11-12 at 4.51.39 PM

How do I go about this?

local chat_on = true
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, chat_on)
1 Like

So as I can see you want to do it from the server, so create a remote event.

Server:

event:FireAllClients(--[[true or false]])

Client:

event.OnClientEvent:Connect(function(value)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, value)
end)
1 Like

This is a nice solution but not the one I’m looking for.

I still want the players be able to chat with each other when the chat window is disappeared. Almost as if the game reverted to just bubble chat.

Turn off the coregui just restricts players from chatting at all.

OH!

use this tutorial

the same server script as before and this client code

event.OnClientEvent:Connect(function(value)
 module.BubbleChatEnabled = not value
 module.ClassicChatEnabled = value
end)
-- true = show window, false = you can just type

I’ve tried that route already and if I even create one function in that ChatSettings corescript, it breaks everything altogether and the player is unable to chat.

However, if you just put:

module.BubbleChatEnabled = true
module.ClassicChatEnabled = true

Then it’s fine. Anything beyond that just breaks the entire chat system.

Reviving this old thread as I still haven’t found the answer yet and I decided to revisit this issue.