How can I make 2 players talk with chat bubbles through one instance while keeping the original chat bubbles hidden for those 2?

I’m working on a steven universe inspired system that involves fusion, basically 2 players become one. The issue is that I don’t know how to handle the chatting. Especially since migration to TextChatService is mandatory, I’m not sure how to do this. I tried the :Chat(message) function but it either didn’t appear in the intended place or overlapped with the other player’s bubble. (in the video both players have duplicate chats but the player 2 chat bubble is lower and the character covers the original chat bubble.

Here’s the code:

local function unifyChatHead(accepter, requester)
local fusedHead = requester.Character:FindFirstChild(“Head”)
if not fusedHead then return end

	local function onChatted(player)
		player.Chatted:Connect(function(message)
			local bubbleChat = game:GetService("Chat")
			bubbleChat:Chat(fusedHead, message, Enum.ChatColor.White)
		end)
	end

	onChatted(accepter)
	onChatted(requester)
end

unifyChatHead(accepter, requester)

https://gyazo.com/65ae1ec2f3d731cc3dad2e9102755e56

3 Likes

Have you tried TextChatService:DisplayBubble()?

1 Like

Yes, but even so, the player (accepter) that’s talking still has the chat bubble in an odd place

1 Like

Are you sure youre displaying the bubbles at the same Part/Character?

1 Like

Yeah the behavior is nice but the “accepter”'s bubblechat appears in the intended place with :displaybubble but the original bubble chat stays in place. is there a way to destroy it or move it to a separate part?

1 Like

I dont think theres a way to disable specific chat bubbles

Though, you could disable the BubbleChatConfiguration to disable all default chat bubbles and display bubbles for players manually using :DisplayBubble() (if they arent fused)

2 Likes

I’m firing a remote for :DisplayBubble(), is there any other way? I’m guessing it’s not that optimal to send a remote for every chat instance

1 Like

what i’d recommend is to make a your very own chat from StarterGui that contains a textbox, a scrolling frame and a textlabel (easy to do) that can be hidden or shown for specific players same as the bubble chat, you can find their imageID in the chat properties in explorer

inside of it, you can maybe add a

-- for _, player in game.Players:GetPlayers() do

and a if statement like this

for _, player in game:GetService("Players") do
   if player.UserID == accepter.UserID then
      -- idk, fire a remotevent then return it on another starterplayer scripts
   elseif player.UserID == requester.UserID then
      -- same statement here
   else return end

tell me if you need more details

1 Like

How would I filter their chats? There’s not much documentation on that

1 Like

its easy

i forgot about that

1 Like

or wait, you can look up in google, all the roblox slurs and then copy and paste it into a table in ur script, incredibly long but if one of them is mentionned, it will replace with either # or these funny things @#/:{^

1 Like

i found it: Text filtering, click and scroll a bit down

2 Likes