If your experience uses TextChatService, you will notice that there is no chat history when you join. You only see new chats that are sent after you joined.
My perspective:
My friend’s perspective:
With the legacy chat (formerly known as “Lua Chat System”), it did store recent chat history, but it only displayed the chat messages from players currently in game. This resulted in awkward things like this:
Before:
After jack leaves, and I rejoin:
Jack is not in the game when I rejoin
A bit awkward with some of the messages missing, since anyone who joins would see those messages and think I’m talking to myself
I created a model that I call Chat History Log for experiences using TextChatService. It stores recent chat history so that joining players can read the conversation from before they joined. It also does not have the "missing chatters" problem that the legacy chat service had.
Chat History Log, my perspective:
Chat History Log, my friend’s perspective:
Names from the chat history log are displayed in the format DisplayName (@Username)
. This ensures you can know the identity of who was chatting, even if they have left the experience.
This is pretty rudimentary, so there’s no user-friendly settings interface or anything. If you can read the scripts, you can edit them to do what you want.
Get it here:
Just place the folder inside ReplicatedStorage and it will work.
Quick facts:
-
The message log is capped at 47 messages. When I tested it, TextChatService started hiding old messages once message #48 was reached.
-
Chat History Log supports names with Verified badges.
- Apparently, Roblox relegates the Verified badge to this symbol:
I guess it’s a dinosaur? Not really sure what that means. I just copied and pasted it from the CoreGui element which had my check mark, and it worked. Trying to paste it here defaults to a placeholder unicode symbol
, so if you want that bit of text, just open up the clientside script in the model.
- Apparently, Roblox relegates the Verified badge to this symbol:
-
This uses Player.Chatted to log chat messages. It does not use any TextChatService callbacks like
OnIncomingMessage
, so you don’t need to worry about those being overridden if you use them. -
Whisper and emote messages (those beginning with
/w
and/e
) are not logged- There seems to be no way to detect team messages in order to prevent them from being logged
-
Chat History Log calls
TextService:FilterStringAsync
when a message is sent, and callsTextFilterResult:GetChatForUserAsync
on all 47 chat log messages when a user joins-
TextFilterResult:GetChatForUserAsync
is not run in 1-by-1 order, but rather it’s run on all logged messages at the same time- This means they are all filtered at the same time, so the client does not need to wait for all messages to be filtered in a yielding chain
-
Messages which fail to load because the filter isn’t working are displayed with this message:
-
Working filter:
- The filtered message was “My phone number is 8352” (not a real phone number)
-
-
-
The entire chat log is displayed as a single system message in the RBXGeneral
TextChannel
, with each individual chat message separated by line feed characters (\n
) -
TextChatService uses RichText, and it is used here to color the parts of the text with player names or “failed to filter” messages
-
Names from the pre-join chat log cannot be clicked or tapped to enter whisper mode
-
The logged chat messages successfully appearing in the chat window is a behavior that, unfortunately, relies upon a race condition being fulfilled (whether the chat window has loaded yet after the user has joined)
If you have any suggestions or have modified/improved the functionality in some way, feel free to post below!