Question about Player.Chatted after the switch to TextChatService

Hello, my game frequently uses Player.Chatted events as a way of inputting codes
From what I understand, Player.Chatted will continue to work, but with slightly altered functionality:

However, having tested out the SendingMessage function, it doesnt seem to detect emote messages (e.x. /e dance)

local tts = game:GetService("TextChatService")
tts.SendingMessage:Connect(function(msg)
	print("chat message " .. msg.Text)
end)

GIF here

The game uses the "/e " prefix to conceal the codes, as any message typed with "/e " before it won’t appear in the chat for other users.

Currently, Player.Chatted detects these messages just fine, but I’m worried about it no longer doing so once legacy chat is fully deprecated

If anyone knows whether that’ll happen (or has a workaround using one of the TextChatService functions) please let me know.

1 Like

What’s probably happening is that the default /e / /emote TextChatCommand is filtering out the message (i.e. “sinking” it), causing .SendingMessage to not fire.

You should consider making a custom Chat Command instead of relying on the Roblox ones for game functionality - In my opinion, depending on the default Commands that exist today is a little flimsy.

2 Likes