You can check the messages by modifying the TextChatMessages given by TextChatService.OnIncomingMessage
--!strict
-- this is on the client
local PlayersService = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")
local function onIncomingMessage(message: TextChatMessage)
local source = message.TextSource
local player = if (source) then PlayersService:GetPlayerByUserId(source.UserId) else nil
if (not player) then return end
message.PrefixText = string.gsub(message.PrefixText, player.DisplayName, player.Name)
end
-- callbacks (like OnIncomingMessage) can only be set to one function
-- if you're setting this callback multiple times, you may have to combine the
-- function above with any other functions you're connecting
TextChatService.OnIncomingMessage = onIncomingMessage