Chat Tag not working

I’m trying to make a chat tag for myself but nothing seems to show up, i’ve looked though the code and nothing seems wrong

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 == "cozfl" then
			properties.PrefixText = "<font color='#fcd303'>[boing]</font>" .. message.PrefixText
		end
	end
	return properties
end

I’ve tried swapping from username to UserID but it didn’t do anything.

I assume there’s a small error in the code but I can’t seem to figure out what it is
any help would be greatly appreciated!

1 Like

Hey! This code seems to work just fine! Just make sure you’re using it within a Local Script in somewhere such as the StarterGUI.

Hope this helps!

1 Like

I moved it into a local script but it still doesn’t seem to be working for me.

1 Like

Weird, is it giving you any errors in the output?

1 Like

Nevermind, accidentally deleted something in the script. Its working now.
Thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.