EasyChat - Customize Player Chat

Update [March 6, 2023] - If you are using EasyChat updated before this date, please update your modules. This update fixes a bug where EasyChat may break when the player respawns. There are also two minor function name changes for EasyChatLegacy (CreateSystemMessage/CreateLocalSystemMessage → SystemMessage/LocalSystemMessage).

If you tried Roblox’s TextChatService, you may have noticed that it works a bit differently compared to what is now the legacy chat, especially when trying to customize one’s chat. Mainly:

  • There is no specialized function like :SetExtraData() to add tags or change colors
  • Customizing chat has to be handled on each individual client
  • And you need to deal with potentially lengthy and confusing rich text formatting

I made a module script that basically simplifies all that into (hopefully) easy-to-use functions. And with the capabilities of rich text, there are many more customization options compared to the legacy chat.

I also made a module script for the legacy chat, but this topic will focus on TextChatService. Documentation for both can be found inside the module scripts.

The asset to the modules can be found here: EasyChat - Roblox

Use the EasyChat module for TextChatService and EasyChatLegacy module for LegacyChatService. Also note that the modules can only be required on the server. Using a module script on an incompatible chat version or client-sided will create a warning and return blank functions.

Here’s a quick example of what you can do with EasyChat:

Example Code
local EasyChat = require(script.Parent.EasyChat)

local Player = game:GetService("Players"):WaitForChild("Denny9876")

-- Adds a single blue tag
-- Player argument can be an instance, string (username), or number (user ID)
EasyChat.AddTag(Player, "Tag", Color3.fromRGB(0, 100, 255))

-- Adds a custom green tag
-- Also supports escape forms!
EasyChat.AddTag(Player, "<Tag2>", Color3.fromRGB(0, 200, 0), true)

-- Adds an orange tag with extra formatting
-- More formatting options are available
EasyChat.AddTag(Player, "{Tag3}", Color3.fromRGB(255, 100, 0), true, {
	FontFace = Enum.Font.SciFi,
	Underline = true,
	Italic = true,
	Stroke = {
		Color = Color3.new(1, 1, 1),
		Joins = "round",
		Thickness = 0.25,
	}
})

-- Customizes player's name
EasyChat.SetName(Player, '('..Player.DisplayName..')', Color3.fromRGB(150, 150, 150), {
	Stroke = {
		Color = Color3.fromRGB(0, 0, 0),
		Joins = "bevel",
		Thickness = 0.5,
	},
	Bold = true,
})

-- Customizes player's message
EasyChat.SetChat(Player, Color3.fromRGB(150, 150, 150), {
	FontFace = Enum.Font.Code,
})

task.wait(3)

-- Display a customized system message
EasyChat.SystemMessage("This is a system message!", Color3.new(1, 1, 1), {Underline = true}, {
	{
		TagText = "🚨ALERT🚨 ",
		TagColor = Color3.fromRGB(255, 100, 100),
		CustomTag = true,
	},
	{
		TagText = "{System}: ",
		TagColor = Color3.fromRGB(255, 200, 0),
		CustomTag = true,
	},
})

If you have any questions, comments, or concerns, simply reply below.

20 Likes

Wow this is super cool, definitly gonna use!

1 Like

Yeah the way how TextChatService works is confusing compared to the legacy chat system. This will be useful for my new computer core I am developing which will have TextChatService in it.

Looks interesting, this could be very useful for some projects!

1 Like