Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why aren't the tags in chat not working?

Asked by
CodeWon 181
2 years ago

My script is supposed to give admins in my group a tag when they speak in chat, but it doesn't.

Error = "TagColor is not a valid member of Color3" - This error doesn't come from the script, but it comes from a defult script in chat serivce. But I think it has to be with my script.

Script:

local ChatService = require(game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

local tags = {
    StaffTag = {TagText = "????", TagColor = Color3.fromRGB(239, 184, 56)}
}

ChatService.SpeakerAdded:Connect(function(playerName)
    local speaker = ChatService:GetSpeaker(playerName)
    local player = game.Players[playerName]

    if player:GetRankInGroup(6153634) >= 4 then
        speaker:SetExtraData("Tags", tags["StaffTag"])
    end
end)

1 answer

Log in to vote
1
Answered by
3F1VE 257 Moderation Voter
2 years ago
Edited 2 years ago

Try

speaker:SetExtraData("Tags",{{TagText = "?????", TagColor = Color3.fromRGB(1,2,3)}})

Also is the script local or server?

0
Still got error CodeWon 181 — 2y
0
Still got error CodeWon 181 — 2y
0
I'll look further into this. 3F1VE 257 — 2y
0
Wait a second, I forgot 2 pairs of brackets, sorry! CodeWon 181 — 2y
Ad

Answer this question