hi,
i am trying to make a multi tag script but when i always try to start the game i always get the same error , if anyone know how to fix will be glad to get some help
here is the script,
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
local Players = game.Players
local users = {
-- ["Username"] = {"UserID", "Vip?", "Booster?", "Helper?", "Admin?", "Dev?"}
["godenotfan007"] = {"239345228", true, true, true, false, true},
--["username"] = {"userid", false, false, false, false, false, false},
}
local function applyTagsToSpeaker(speaker)
local speakerName = speaker.Name
local player = Players:FindFirstChild(speakerName)
if player then
local userId = player.UserId
local user = users[player.Name]
if user and user[2] == userId then
local tags = {}
if user[6] or user[7] then
table.insert(tags, {TagText = "Staff", TagColor = Color3.fromRGB(255, 255, 0), TagFont = Enum.Font.Cartoon})
end
if user[3] then
table.insert(tags, {TagText = "Vip", TagColor = Color3.fromRGB(255, 255, 0), TagFont = Enum.Font.Cartoon})
end
if user[4] then
table.insert(tags, {TagText = "Booster", TagColor = Color3.fromRGB(255, 192, 203), TagFont = Enum.Font.Cartoon})
end
if user[5] then
table.insert(tags, {TagText = "Helper", TagColor = Color3.fromRGB(44, 255, 213), TagFont = Enum.Font.Cartoon})
end
if user[6] then
table.insert(tags, {TagText = "Admin", TagColor = Color3.fromRGB(26, 29, 255), TagFont = Enum.Font.Cartoon})
end
if user[7] then
table.insert(tags, {TagText = "Dev", TagColor = Color3.fromRGB(163, 58, 255), TagFont = Enum.Font.Cartoon})
end
speaker:SetExtraData("Tags", tags)
end
end
end
local function applyTagsToAllSpeakers()
for _, speaker in ipairs(ChatService:GetSpeakerList()) do
applyTagsToSpeaker(speaker)
end
end
ChatService.SpeakerAdded:Connect(function(speaker)
applyTagsToSpeaker(speaker)
end)
applyTagsToAllSpeakers()