I have this issue right here about the new bubble chat customization options. Basically, my game has rank, so I’m trying to give each player a colored chat based on their rank but I keep getting this error which I cannot understand.
It’s saying that it’s expecting a “table” for TextColor3
, however, if we go in the DevHub, we can find this:
Which means the value type requested for
TextColor3
is actually a Color3
.This is my current code:
-- This is the table containing all the ranks and their options
local ChatRanks = {
["Owner"] = {
TextColor3 = Color3.fromRGB(255, 125, 125);
BackgroundColor3 = Color3.fromRGB(75, 0, 0);
};
["Developer"] = {
TextColor3 = Color3.fromRGB(140, 255, 157);
BackgroundColor3 = Color3.fromRGB(0, 40, 18);
};
["Skippy"] = {
TextColor3 = Color3.fromRGB(209, 209, 209);
BackgroundColor3 = Color3.fromRGB(0, 0, 0);
};
["Moderator"] = {
TextColor3 = Color3.fromRGB(222, 175, 241);
BackgroundColor3 = Color3.fromRGB(45, 0, 72);
};
["Player"] = {
TextColor3 = Color3.fromRGB(0, 0, 0);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
};
};
-- This is the code that gives the player a LocalScript which should set the chat customizations:
local Rank = Moderation_DS:Get().Rank; -- Saved and loaded with DataStore2
local ChatSet = script.Chat:Clone();
ChatSet.Parent = Character.UpperTorso;
ChatSet.Disabled = false;
wait(.5);
ChatSet:WaitForChild("R"):FireClient(Player, ChatRanks[Rank]);
ChatSet.R.OnServerEvent:Connect(function()
ChatSet:Destroy();
end);
-- LocalScript:
local ChatService = game:GetService("Chat");
script:WaitForChild("R").OnClientEvent:Connect(function(Table)
ChatService:SetBubbleChatSettings({
UserSpecificSettings = Table;
});
script.R:FireServer();
end);
Anybody can understand what I’m doing wrong here? Thanks in advance.