Need help with Chat name tags

Hello! How is it going? I am currently working on Player name tags and chat tags. However, I get this error:


And that is

Speaker:SetExtraData("Tags", {TagText = UserTag, TagColor = TagColor})

Speaker is

local Speaker = ChatService:GetSpeaker(Player.Name)

And the Player Added is

game:GetService("Players").PlayerAdded:Connect(function(Player)

My first solution was to check the DevHub for any typos, and there were none. My second was to add this to speaker:

 or ChatService.SpeakerAdded:Wait()

But same error.

If you could help me, please let me know. Thanks! WE

They are a few related articles, which will fix your problem.

In a server script:

local Players = game:GetService('Players')
local ServerScriptService = game:GetService('ServerScriptService')

local ChatService = require(ServerScriptService:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))

ChatService.SpeakerAdded:Connect(function(PlayerName)
	local Speaker = ChatService:GetSpeaker(PlayerName)
	if (Players[PlayerName].Stats.BetaTester.Value == true) then
		Speaker:SetExtraData('NameColor', Color3.fromRGB(209, 193, 97))
		Speaker:SetExtraData('ChatColor', Color3.fromRGB(178, 248, 229))
		Speaker:SetExtraData('Tags', {{TagText = 'Beta Tester', TagColor = Color3.fromRGB(189, 83, 83)}})
	end
end)
1 Like