Error when trying to change player name chat color

I am trying to make every player name in the chat appear as a grey color to remove the normal color variation in player’s names.
However, when trying to do this I get the error:
attempt to call missing method ‘SetExtraDetails’ of table
This comes from the speaker:SetExtraDetails("NameColor",{NameColor = Color3.fromRGB(171, 171, 171)}) line in this script:

local groupid = 14348744

local Players = game:GetService("Players")
local serverScriptService = game:GetService("ServerScriptService")
local chatService = require(serverScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))


chatService.SpeakerAdded:Connect(function(player)
	local Player = Players:FindFirstChild(player)

	local speaker = chatService:GetSpeaker(player)
	speaker:SetExtraDetails("NameColor",{NameColor = Color3.fromRGB(171, 171, 171)})
	if Player:IsInGroup(groupid) then
		local role = Player:GetRoleInGroup(groupid)
		if role == "Fan" then
			speaker:SetExtraData("Tags",{{TagText = "Fan", TagColor = Color3.fromRGB(240, 157, 89)}})
		elseif role == "Tester" then
			speaker:SetExtraData("Tags",{{TagText = "Tester", TagColor = Color3.fromRGB(23, 157, 240)}})
		elseif role == "Owner" then
			speaker:SetExtraData("Tags",{{TagText = "Owner", TagColor = Color3.fromRGB(240, 0, 220)}})
		end
	end
end)

I’m not too sure what the correct way to go about this is as I cant find any documentation on how to change NameColor when using :SetExtraDetails.

It’s :SetExtraData iirc, not :SetExtraDetails.

You also aren’t formatting the function call correctly, it should be:

speaker:SetExtraData('NameColor', Color3.fromRGB(...))
1 Like

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