-
What do you want to achieve? Name tag not working at all
-
What is the issue?

The print keep spamming. I used delay to avoid error. -
What solutions have you tried so far? I didn’t find one.
Name Tag Script
local ServerScriptService = game.ServerScriptService
local ChatService = require(ServerScriptService:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
local Players = game:GetService('Players')
local Config = require(script.Config)
local PlayersTags = {}
local function GetPlayerTable(Name:string)
task.wait() print(Name)
return PlayersTags[Name] or GetPlayerTable(Name)
end
Players.PlayerAdded:Connect(function(Player)
PlayersTags[Player.Name] = {
Tags = {};
Player = Player
}
local PlayerTag = GetPlayerTable(Player.Name)
for index,value in pairs(Config) do
local use = false
if Player:IsInGroup(value.GroupId) then
if value.RankId ~= 0 then
if Player:GetRankInGroup(value.GroupId) >= value.RankId then
use = true
end
else
use = true
end
end
if use then
table.insert(PlayerTag.Tags, value[3])
end
end
end)
Players.PlayerRemoving:Connect(function(Player)
PlayersTags[Player.Name] = nil
end)
ChatService.SpeakerAdded:Connect(function(PlayerName)
local Speaker = ChatService:GetSpeaker(PlayerName)
local PlayerTags = GetPlayerTable(PlayerName)
--Player:IsInGroup(RgGroup)
if PlayerTags.Tags then
if #PlayerTags.Tags ~= 0 then
Speaker:SetExtraData('Tags', {unpack(PlayerTags.Tags)})
end
end
end)
I appreciate if you able to fix.
