Hey everyone,
I’ve written a script that spawns a local part, and copies the text output from the LocalPlayer in that separated part, that has a bubble like this:
The purpose of doing this, is so you can see the bubble chat when you’re in first person (This is the third person toggle button to show my issue)
The problem is, that part displaying the bubble is unfiltered and doesn’t distiguishes between “/whisper” or “/e…msg” and similar. But my main problem here is the fact that it’s not filtering. (Though I would appreciate if you could help me with the second one)
For the filtering problem, I’ve tried looking at the Text and Chat Filtering post in the DevHub, but I can’t get my head around it. I’ve also looked up older DevForum posts and nothing. And yes, I’m testing in-game and not in Studio, I know it doesn’t filters there.
Here’s the relevant part of my code that duplicates the Client’s chat:
-- [ DUPLICATE CLIENT CHAT INTO BUBBLE PART]
game.Players.LocalPlayer.Chatted:Connect(function(msg)
ChatService:Chat(part, msg)
end)
As for the second issue I have, it doesn’t seems to identify when to not spawn a bubble, like so:
I have tried to use string.match
to identify wherever or not to duplicate the chatting, but the way I did it doesn’t works.
I don’t have the exact code I wrote for that as I discarded it quite quickly, but here’s what I remember I tried to do:
-- [ DUPLICATE CLIENT CHAT INTO BUBBLE PART]
game.Players.LocalPlayer.Chatted:Connect(function(msg)
if not msg:Match("/e")..msg or ("/e") or ("/w") or ("/whisper") or ("/t") then
ChatService:Chat(part, msg)
else
end
end)
That’s about it, I’m probably missing something obvious but I’ll learn eventually, got into coding just a few months ago, thanks in advantage for anyone helping!