Chat tags erroring out and not working

Hey guys,
So I was messing around with the chat and I decided to make some chat tags. It errors out saying

SpeakerAdded is not a valid member of ModuleScript "ServerScriptService.ChatServiceRunner.ChatService"

I don’t know why this is happening, here’s my script in ServerScriptService:

local ChatService = game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService")
local developers = {1998082358, 302070682}
ChatService.SpeakerAdded:Connect(function(playerName)
	local speaker = ChatService:GetSpeaker(playerName)
	if table.find(developers, game.Players[playerName].UserId) then
		speaker:SetExtraData("Tags", {text = "Developer", color = Color3.fromRGB(0, 170, 255)})
	end
end)

Thanks!

  • anirudh851

You forgot to require the ChatService module script

2 Likes

Required it. now it errors saying TagColor is not a valid member of color3

Oh right, the tags have to be in a table

speaker:SetExtraData("Tags", {text = "Developer", color = Color3.fromRGB(0, 170, 255)})

Should be

speaker:SetExtraData("Tags", {{TagText = "Developer", TagColor = Color3.fromRGB(0, 170, 255)}})

Since they also have specific names

1 Like

Dang I removed the table before starting thinking its unnecessary. Will test.

It worked but it sets the tag name to “???”.

Also the it doesn’t set the color.

Did you remember to name the keys like I did?

I didnt :flushed: ill try and reply. i thought u could use any name for the keys cuz i have the habit of taking things for granted lol :wink: