Chat Script Help

What do I want to achieve?
I’m trying to customize the default roblox chat font

What’s the problem?
I have a script in the StarterGui that requires the chat modules, but the ChatBarFont does not apply in-game

Here’s the script:

local ChatModules = require(game.Chat:WaitForChild("ClientChatModules").ChatSettings)

ChatModules.DefaultFont = Enum.Font.Gotham;
ChatModules.ChatBarFont = Enum.Font.Gotham;

Please tell me other settings of the chat module if you can, so I could possibly go further with my settings.

1 Like

In the script change Gotham to whichever font you want.

I know, but the ChatBarFont wont change when I play test it

Can I please see a video of this?

I probably cannot send you a video, but I can send a screenshot

Ok, just send a screenshot of the problem.

ModuleScripts aren’t editable like you may think. When you require() a module, it returns a copy of whatever it returns. Meaning all you did in your script was edit a copy of the module and not the module itself. But also, scripts that run during your game don’t have the security necessary to edit the .Source property, meaning you can’t change it.

So how do you get around this? Play test the game, copy the ClientChatModules, exit the play test, then paste the ClientChatModules in the Chat instance you see in the explorer, then you can edit the font from there.

Yeah, when you do that you will be able to edit and the ChatBarFont shall work.

This will not work, , if I remember correctly. You’ll need to create a local script in StarterPlayerScripts.

Try pasting this code into the local script.

-- Require the ChatSettings module (wait for it to load)
local Chat = game:GetService("Chat")
local ClientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatSettings = require(ClientChatModules:WaitForChild("ChatSettings"))
-- Change settings like you would with any other table.
ChatSettings.DefaultFont = Enum.Font.Gotham;
ChatSettings.ChatBarFont = Enum.Font.Gotham;

That should work, let me try it.

1 Like

I have had this problem many times but the ClientChatModules are only available when you hit “Play” and test the game.

1 Like

You can copy the folders while you’re inside the test. Then you can end the test, and paste it into the Chat in Explorer.

Exactly the point! Once you understand how to work with chat settings it becomes quite easy to work with.

1 Like

This post can also help too by the way:

1 Like

What we all just explained should be able to fix the problem!

I hope we all found the solution for you!

Yes, you did indeed! Thanks for the help!

1 Like

To make people know that the problem has been solved you need to check of Solution on somebody. Can be anyone.

1 Like

Just check solution on anyone’s chat to end this topic post.

Wait, would this cause a duplicate of the chat modules to exist while playing the game?

1 Like