TextChatService events are not firing if connected inside a server script

The goal is to get any chat message sent by any player using TextChatSevice not “Player.Chatted” one.

The problem is that TextChatService’s both events “MessageReceived” and “SendingMessage” aren’t firing (Server) if there is a chat message made but, for some reason, they worked properly on a client-side script “local script”! What is the issue here?!
I’ve tried searching around and reading the documentation pages but no luck yet.

Here is the code I’ve tried and there are no outputs from both connections:

local TextChatService = game:GetService("TextChatService")

TextChatService.SendingMessage:Connect(function(Message)
	warn("Message received.")
	OnChatted(Message.TextSource.UserId, Message) 
end)

TextChatService.MessageReceived:Connect(function(Message) 
	warn("Message received.")
	OnChatted(Message.TextSource.UserId, Message) 
end)
1 Like

As far as I know, the TextChatService service only runs on the client. You should probably use the .Chatted event instead.

Well, if that is true why didn’t Roblox say that in the documentation?
I was using .Chatted event but I thought it would be better to use TextChatService for its advantages…

For anyone not using ‘game:GetService("TextChatService")’, TextChatService is a chat module that allows the user to use chat commands.

The difference between ‘TextChatService.SendingMessage:Connect()’ and TextChatService.MessageReceived:Connect()’ is that SendingMessage is triggered when the server sends the message to the player, while MessageReceived is triggered when the player receives the message.

If you want to get the message when it’s sent, use SendingMessage. If you want to get the message when it’s received, use MessageReceived.

That is not true at all. TextChatService works on the Client AND the Server

Can I see this function on where it defined?

This is not needed, the whole connected function ain’t being executed whether its with this local function or not…

Got it. I always thought it used the DefaultChatSystemChatEvents folder, but that must be for LuaChat.

What advantages are there? .Chatted will give you the message, and I’ve used it for years. Am I missing something?

1 Like