Can't Use TextChatService.OnIncomingMessage

I am trying to use the TextChatService.OnIncomingMessage callback; however, I am unable to get it to run. In the following script, both the top and bottom prints appear in console, but “incoming message” is never seen. How can I adjust my code to function as intended?

print("Running")
game:GetService("TextChatService").OnIncomingMessage = function()
	print("Incoming message")
	return
end
print("Connection successful")

Is this script a LocalScript? Do you have TextChatService enabled?

Ah, that’s the issue! I didn’t realize this wouldn’t work alongside the legacy chat. Thank you!

@Katrist Do you happen to know what I would use to achieve this behavior with the legacy chat? I’d like to change the text of incoming messages for certain users.

It’s going to be much more complicated but here’s a doc on it:

I would recommend switching to the new chat service.

1 Like

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