Hello, I was working on a script that would basically add tag to your name in chat and change your text color if you have sufficient rank in certain group, but the script isn’t working at all. Any idea what the problem could be?
local players = game:GetService("Players")
local serverScriptService = game:GetService("ServerScriptService")
local chatService = require(serverScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
chatService.SpeakerAdded:Connect(function(player)
local Speaker = chatService:GetSpeaker(player)
if player:GetRankInGroup(9965171) >= 254 then
Speaker:SetExtraData("Tags", {{TagText = "Central Directory", TagColor = Color3.fromRGB(128, 0, 128)}})
Speaker:SetExtraData("ChatColor", Color3.fromRGB(255, 198, 26))
elseif player:GetRankInGroup(9965171) <= 253 and player:GetRankInGroup(9965171) >= 250 then
Speaker:SetExtraData("Tags", {{TagText = "Administration", TagColor = Color3.fromRGB(230, 0, 230)}})
Speaker:SetExtraData("ChatColor", Color3.fromRGB(255, 198, 26))
else
end
end)
I used Print to see if I could find the problem, but even the chatService.SpeakerAdded:Connect(function(player)
does not run.