Help me to make the ChatTag bold

  1. What do I want to achieve?
  • I need to make the ChatTag bold (line 20)

Hi, I’ve been making a chat tag for devs in my game, and I made the chattag, but I really don’t know how to make it bold (like on the line 21)

local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")

local chatWindowConfiguration = TextChatService.ChatWindowConfiguration

local gradient = Instance.new("UIGradient")
gradient.Color = ColorSequence.new{
	ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
	ColorSequenceKeypoint.new(0.5, Color3.fromRGB(200, 0, 0)),
	ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 0, 0))
}

TextChatService.OnChatWindowAdded = function(message: TextChatMessage)
	local properties = chatWindowConfiguration:DeriveNewMessageProperties()

	if message.TextSource then
		local player = Players:GetPlayerByUserId(message.TextSource.UserId)
		
		if player:GetAttribute("IsDev") == true then
			properties.PrefixText = "[DEV]"
			properties.Text = string.format("<b><font color='#ff0000'>%s</font></b>", message.PrefixText) .. " " .. message.Text

			properties.PrefixTextProperties = chatWindowConfiguration:DeriveNewMessageProperties()
			gradient:Clone().Parent = properties.PrefixTextProperties
		end
		
	end

	return properties
end

It looks like this in-game:
image
But the ChatTag [DEV] should be bold like the name.

3 Likes

To make a text bold, you can do this:
<b>TEXT HERE</b>
You can make a text italic by doing this:
<i>TEXT HERE</i>

.
So in your case, instead of doing:
properties.PrefixText = "[DEV]"
You should do
properties.PrefixText = "<b>[DEV]</b>"

3 Likes