How to Create a Custom Chat Tag

That was amazing i was confused how it works

ChatMessage objects have an extra data field, as does the SayMessage function. You can do it in any number of ways as long as you keep in mind to modify the tags key of the ExtraData table. ChatSpeaker’s ExtraData table is to have a consistently sent ExtraData table when sending a message ergo to avoid the whole idea of constantly constructing and passing tags or other data every time a message is sent.

1 Like

I am a new scripter and i kind off understood this tutorial

I followed the tutorial exactly but it’s not working for me. There is no output from the script. If it helps I’ve followed other tutorials for this and none of them have worked either so it’s definitely something on my end.

Apparently I’ve read ChatServiceRunner is deprecated already and therefore it doesn’t work. The solution to this is using TextChatService. This code worked for me. I put it in a LocalScript located in StarterGui. Hope this works for you.

local player = game.Players.LocalPlayer
local TCS = game:GetService("TextChatService")

TCS.OnIncomingMessage = function(message: TextChatMessage)
	if not message.TextSource then return end
	
	local properties = Instance.new("TextChatMessageProperties")
	
	if player.Name == "Isipro_Ahre" then
		properties.PrefixText = "<font color='#ff0000'>[Developer]</font> " .. message.PrefixText
	end
	
	return properties
end

7 Likes

I have created a post on how to create a custom chat tag in the latest chat service of Roblox. You can find it here :

2 Likes

can someone tell me a way to use group id and rank id to give tag

edit: TypeInt’s custom chat post has my answer

Insert a LocalScript into StarterPlayerScripts and then use this script.

local TextChatService = game:GetService("TextChatService")

TextChatService.OnIncomingMessage = function(message: TextChatMessage)

    local properties = Instance.new("TextChatMessageProperties")

    if message.TextSource then
        local player = game:GetService("Players"):GetPlayerByUserId(message.TextSource.UserId)

        if player.Name == "username" then
            properties.PrefixText = "<font color='#2f0445'>[OWNER]</font> " .. message.PrefixText
        end
    end

    return properties
end
3 Likes