Player.Chatted not firing on the client for the local player with TextChatService

In this video, I demonstrate how the “/cmds” command in my game is broken with the new chat, but still works when forcing the old chat to reappear

The command not working is due to Player.Chatted not firing on the client, (although it does fire on the client, but for players other than the local player). This has been an issue since the release of TextChatService. I was hoping that the LegacyChat running in the background on migrated games would prevent this issue, but this is not the case

There has already been a bug report for this, Player.Chatted not firing on client when the chat version is set to TextChatService, However, this bug report was closed right away it seems, after the first reply was marked as a solution

The marked solution says to basically not use Player.Chatted with TextChatService. Problem is that now, this is breaking games due to the recent forced migration to TextChatService. Maybe the older bug report should be reopened?

It is also unclear if Player.Chatted is going to get deprecated or not. It still has use, mostly for getting chat messages on the server, as the alternative is to use a remote event with SendingMessage or OnIncomingMessage

Repo file (same one as the other thread): Reproduction.rbxl (35.9 KB)

System information:
Ryzen 5 5600G, 8Gb of DDR4 RAM, …

Expected behavior

I expect Player.Chatted to fire on the client for messages sent by the local player, or a full deprecation of Player.Chatted

1 Like

My game breaking is not very important as it’s dead anyway, but I am worried for other games, notably Blockate, which has a very similar chat command system, and has yet to be migrated to TextChatService

Because of the migration to the TextChatService, you also have to migrate to the new methods.

Take a look at the documentation.

I’ve talked about this in the report

Right but this isn’t a bug, you are supposed to migrate over to TextChatService. That’s how deprecation works. AFAIK Roblox is no longer using the old TextChat, and now uses the TextChatService in the backend.

In the software world we call this a breaking change, and Roblox has been telling developers to migrate over ASAP, since they released TextChatService a while back. Breaking changes happen and we have to adapt to them as developers.

So for clarification, this is not a bug, and is instead an intended breaking-change.

I’m not sure this is a wanted breaking change by Roblox. This issue has kind of been lurking in the background for a while, and was never actually addressed oddly enough. I do believe it is a bug, as it was never properly addressed

I also assume it would make sense to fix Player.Chatted, that would avoid many issues, and as stated, could still be useful. The documentation also doesn’t state any incompatibility with TextChatService, or any upcoming deprecation. It just seems outdated

Roblox usually tries to avoid breaking changes, this one would be easy to avoid as well I think. But what I want is an actual response from an admin or an engineer at roblox about the state of Player.Chatted. The other thread was closed prematurely imo, and never go an answer from Roblox staff

Roblox does do breaking changes when necessary.

The old ChatService is being deprecated in favor of TextChatService

Regardless of how you feel or if this was wanted (most things Roblox does nowadays are unwanted), it’s still a change you’re going to have to adapt to.

As a correction, the Chat base service IS deprecated. You need to migrate to the new TextChatService.

The reason why Player.Chatted no longer fires is because Chat.Chatted is no longer fired.

Chat is deprecated, but not Player.Chatted

Interestingly, Player.Chatted is managed by Player:Chat(), (and probably Chat:Chat()), as commenting this line of code in the LegacyChat, causes Player.Chatted to stop working on both the client and the server
image

I assume Player:Chat() is a typo, as only Players:Chat() exists, and it is restricted, having plugin security. If you are wondering how the LegacyChat is able to call it, it’s because it communicates with core scripts through :SetCore()

However, this is not true, .Chatted doesn’t seem to be fired by LegacyChat when a player sends a message, only when Chat:Chat() is called (I tested it on a local file). Player.Chatted and Chat.Chatted don’t seem to be linked
Moreover, Player.Chatted not working isn’t caused by the LegacyChat no longer sending the message to the “C++ legacy stuff”, otherwise it wouldn’t be working at all. So it’s likely that roblox has reimplemented code to fire Player.Chatted from TextChatService, but there was an issue with their implementation?


@tannnxr (sorry to tag you but I accidentally posted my reply before it was done, and I don’t want to make yet another not so useful reply to this topic)

Why are you even trying to convince me to drop this bug report? Or trying to convince me to migrate, but I’ve already done so for the games I care about…
I’m writing this report because something isn’t quite right with Player.Chatted, and also because I don’t like seeing old games being broken. Your input regarding this topic has been unhelpful to say the least, this is not about “just migrate to TextChatService”. This thread is getting embarrassingly unprofessional, so, if you don’t have any other information than “migrate to TextChatService”, I would ask you to not spam this further

I’m sorry to be mean but I am getting annoyed a little

Your input about Chat.Chatted is more useful, but I would ask for a deeper explanation because it doesn’t make sense to me. And I don’t see how Chat.Chatted and Player.Chatted are connected, classes don’t work like that, Chat is not a parent class of Player, unless we are talking about interfaces like Java has, which I have not heard of in the context of roblox. Even so, they don’t fire for the same thing…

1 Like

Chat.Chatted is the base class of Player.Chatted with updated meta-methods so to speak so as to only fire when a player chats. As far as I am aware they ARE connected, just not directly the exact same class.

What’s the replacement for Player.Chatted then? I looked but I can’t seem to find it.

Current solutions are either using the built in TextChatCommands, or, for custom chat command systems, either SendingMessage or maybe OnIncomingMessage the first time it is fired for the sending client

I’m my post I have mentioned MessageReceived, but this one wont do because it only includes the filtered message. I confused it with OnIncomingMessage (gonna fix that)

SendingMessage and OnIncomingMessage are only fired on the client, so for server sided commands, if you use this method, you need to send the data to the server through a remote. Player.Chatted works on the server, so that is also an option, unless it becomes deprecated

I did try OnIncomingMessage on the client but it just gave me an error saying I can only set a callback value get is not available.

This is just very confusing.

1 Like

Funny to see this being an issue back in 2016 as well. Less funny to see that there is less care for this kind of stuff nowadays. Any update or anything about this?

Hello! We’ve recently made changes to the Player.Chatted event where it will now fire for the local sender. Your repro should be working as expected now.

For command usecases, we do recommend leveraging TextChatCommand.Triggered with a PrimaryAlias of /cmd

1 Like

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