I'm making a GUI where the player can change their bubble text colour and bubble background colour.
Upon clicking a button, either the text or bubble colour can be changed, and the text displays in its new colour, and is saved to the server in a customPlayerChat table, in either a BackgroundColor or TextColor field for the player who changed it.
However, even if no colours are changed via the GUI, the error: Error occurred while calling TextChatService.OnBubbleAdded: TextColor is not a valid member of Color3 -- Client appears, and the bubble doesn't show up above the player's head UNTIL either the text colour or the bubble colour have been changed using the GUI.
Here's the client script where I think the problem is coming from. Does anyone know what could be causing this?
TextChatService.OnBubbleAdded = function(message: TextChatMessage, adornee: Instance)
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
local customPlayerChat = getTextColourEvent:InvokeServer(player) or Color3.fromRGB(57, 59, 61) -- Get the player's colour or grey if player has no custom color
local chatCol = customPlayerChat and customPlayerChat.TextColor or Color3.fromRGB(57, 59, 61) -- Default to grey if nil
local bubbleProperties = Instance.new("BubbleChatMessageProperties")
bubbleProperties.TextColor3 = chatCol
local customPlayerChat = getBubbleColourEvent:InvokeServer(player) or Color3.fromRGB(250, 250, 250)
local bubbleCol = customPlayerChat and customPlayerChat.BackgroundColor or Color3.fromRGB(250, 250, 250)
print("Received background colour: ", bubbleCol)
bubbleProperties.BackgroundColor3 = bubbleCol
return bubbleProperties
end
end