I want to make an actor system, in which people can choose from different entities to play as. Some of these entities require unique chat bubbles to fit their asthetic(colors, fonts, etc), but with the new roblox textchatservice, I can’t seem to find out how to do it.
I tried using the older chat service, but something seemingly broke about game.Chat:SetBubbleChatSettings()
It looks like you cannot make people have their own individual chat bubbles that they can configure for every player without making your own implementation, however, I am willing to help you with making a Bubble Chat system that players can customize. Here is a basic implementation on how you can do it.
Please be sure to put this script in ServerScriptService:
local experience = game
local Chat = experience:GetService("Chat")
local function UpdateBubble(TextBubble, BubbleSettings)
TextBubble.BackgroundColor3 = BubbleSettings.BackgroundColor
TextBubble.Font = BubbleSettings.Font
end
experience:GetService("Players").PlayerAdded:Connect(function(Player)
local BubbleChatBillboard = Instance.new("BillboardGui")
local TextBubble = Instance.new("TextLabel")
TextBubble.Text = ""
TextBubble.Visible = false
TextBubble.Size = UDim2.new(1, 0, 1, 0)
TextBubble.Parent = BubbleChatBillboard
BubbleChatBillboard.Parent = Player
-- Assuming you are using an attribute for the Settings inside the Player
Player.ChatBubbleSettings.AttributeChanged:Connect(function()
UpdateBubble(TextBubble, Player.ChatBubbleSettings:GetAttributes())
end)
UpdateBubble(TextBubble, Player.ChatBubbleSettings:GetAttributes())
Player.Chatted:Connect(function(Message)
local Success, Error = pcall(function()
local FilteredMessage = Chat:FilterStringForBroadcast(Message, Player)
TextBubble.Text = FilteredMessage
TextBubble.Visible = true
task.delay(10, function()
TextBubble.Visible = false
end)
end)
end)
end)