Player.Chatted not detecting a chat message

I have a simple local script

game:GetService("Players").LocalPlayer.Chatted:Connect(function(message)
	print(1234)
end)

and it is not working, any suggestions for how to detect a chat message?

1 Like

Would have worked with the legacy chat, but the new TextChatService comes with different methods.

The flowchart in this article is very neat for understanding the flow: In-Experience Text Chat System | Documentation - Roblox Creator Hub and appropriate events.

local TextChatService = game:GetService("TextChatService")

TextChatService.SendingMessage:Connect(function(textChatMessage)
	print("Channel: "..textChatMessage.TextChannel.Name)
	print("Text: "..textChatMessage.Text)
end)
11 Likes

If you’re using the new TextChatService and not the LegacyChatService, this may definitely not work. There are work arounds but its best to establish if you would rather want to detect chat from the Client-side or on the Server-side, and why you need it to detect messages on that side (Server side wise may be a bit simpler to code).

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.