Hello Developers!
Recently I started scripting a system that passes information from tables into a function that sets a players chat color or adds tags.
For example I have this table here that handles tag information and passes it into a function
local Colors = {
["Gamepass Colors"] = {
["DiamondMember"] = {Color3.fromRGB(175, 221, 255), 0, "šDiamond Memberš"},
["GoldMember"] = {Color3.fromRGB(239, 184, 56), 0, "āGold Memberā"},
},
["Execlusive Colors"] = {
["dacastle"] = {Color3.fromRGB(255, 0, 0), 0, ""},
["aIphabox"] = {Color3.fromRGB(255, 155, 240), 0, ""},
["EgghuntWinner"] = {Color3.fromRGB(255, 155, 240), 0, ""},
}
}
local function SetColor(Player, Color, Rank, Tag)
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
local TagText = Tag
local TagColor = Color
local Speaker = nil
local Tag = {
TagText = TagText,
TagColor = TagColor
}
while Speaker == nil do
Speaker = ChatService:GetSpeaker(Player.Name)
if Speaker ~= nil then break end
wait(0.01)
end
if Tag ~= "" then
Speaker:SetExtraData("Tags", Tag)
end
print(TagColor)
Speaker:SetExtraData("ChatColor", Color3.fromRGB(0, 0, 0))
end
But when I chat my message doesnāt show and it errors on line 18 of the function:
TagColor is not a valid member of Color3
which links you to
of DefaultChatMessage?
Any reason why this is happening?