Player.Chatted Event not firing for desktop

- Detailed description of bug: My game Paint 'N Guess heavily uses the Player.Chatted event. Today (August 22nd, 2020), at approximately 6:20am PDT, I joined a VIP server with a friend. Just to give a brief summary of how the game is played, players draw their given word on the painting board and spectating players will attempt to guess the selected word in the chat. The scripts have worked for a very long time and prior to today, the last time the game was updated at all was on August 8th, 2020 at 7:14:20 PM (I’m not sure which timezone this is from… whatever timestamp the website uses by default I assume)

Anyways, the game wasn’t registering our guesses in chat and I immediately checked the Developer console, both client-side and server-side, for any error messages. None appeared. I proceeded to open Roblox Studio to inspect the part of the script that handles this functionality. I inserted print statements between the functions to determine where the problem was occurring considering I wasn’t getting much luck from the developer console. I published to ROBLOX and we rejoined the server.

game.Players.PlayerAdded:Connect(function(player)
    print("test0")
    player.Chatted:Connect(function(msg)
    print("test1")
    end)
end)

This time in the output, “test0” printed but “test1” did not. Again, no errors in the developer console. At this point, I’m making the reasonable assumption that there is a problem with the player.Chatted event.

My friend and I left the VIP server and joined a public server to see if they were having the same issue. In fact, they were, however only for some users. A few users, including ourselves, weren’t getting our “guesses” recognized but other players were. My friend suggested that perhaps it could be a platform issue considering we both play from Mac. This is where we began server hopping and surveying other players about which platform they’re playing from. We discovered that players who got their “guesses” recognized were primarily playing from Windows 10 or Mobile and those playing from Mac were experiencing the same issue as us - the event not firing. (More specifically, macOS Catalina 10.15.6 users)

It has since been several hours later… as of right now (10:31pm PDT) and the issue still persists and I surprisingly don’t see any other forums on this particular issue (though I’ve seen a couple comments around the forum from today about Mac users experiencing chat issues in general)

- Where the bug happens (be specific); I’m not sure if any other games are experiencing this issue but its definitely been an issue on my game: Paint 'N Guess

- When it started happening; As far as I can tell, it started today, August 22nd. As aforementioned however, I didn’t experience it firsthand until 6:20am PDT this morning.

- Steps to reproduce the issue (be minimal, specific, consistent!); Go into Studio, create a new server script in ServerScriptStorage and use the player.Chatted event, publish the game, and attempt to trigger the event from a computer utilizing macOS Catalina 10.15.6.

game.Players.PlayerAdded:Connect(function(player) -- This line will execute
    print("print Test 0") -- This line will execute
    player.Chatted:Connect(function(msg) -- This line (and below) will NOT execute for Mac Users
	        if (player.UserId == 32116151) and (msg == "!start") then 
			print("If-statement executed because user 32116151 said '!start'") -- This line will NOT execute
			end
    end)
end)
9 Likes

This doesn’t seem to happen to Mac users only.
It didn’t work on my Windows.
As a result of analysis, it was found that a line feed code was included after the message.
I think this is a bug.

Mac - Catalina 10.15.4
Windows - Build 20190.rs_prerelease.200807-1609

1 Like

This has been happening to some of the users in my game as well. There have been multiple complaints from Mac users that they cannot run commands some of the time in this game. I started getting reports of this issue around two days ago from multiple users. When they run /e mod, they are meant to get a GUI on their screen. A user shared that they were using Mac - Catalina 10.15.6. Here is a clip of it happening yesterday:

1 Like

I don’t believe that’s a similar issue. The problem here is that the event in its entirety won’t fire at all, including a simple print statement.

edit: I just tested it out using the solution you provided, it still won’t work. :confused:

Thanks!

I’m starting to receive multiple reports (more frequently than yesterday) that this issue isn’t limited to Mac users and there are a handful of window users experiencing this as well. From what I can determine, mobile users haven’t reported this problem to me and I’m making the assumption that its a problem limited to desktop. I updated the thread title to remove ‘Mac users’

This is now the 2nd chat related issue.

I’ve been having a issue where Chatted messages would have a newline(“\n”) at the end of the message making basic chat commands harder to test in studio having to take the msg and sub it by the length of the msg and subtract by 1.

So your section about this:

game.Players.PlayerAdded:Connect(function(player) -- This line will execute
    print("print Test 0") -- This line will execute
    player.Chatted:Connect(function(msg) -- This line (and below) will NOT execute for Mac Users
	        if (player.UserId == 32116151) and (msg == "!start") then 
			print("If-statement executed because user 32116151 said '!start'") -- This line will NOT execute
			end
    end)
end)

Actually has a 2nd bug preventing it from functioning properly. For some odd reason, it has been 2 days now my bug report has been ignored regarding it. There hasn’t been a approval or decline replied about my post.

1 Like

I’m unable to parse messages using the player.Chatted event.

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		print(msg:lower())
		if msg:lower() == "command" then
			print('running')
		end
	end)
end)

It will print the message in lower case, but it will not the ‘running’ print from the if statement

Can confirm for some reason…
image


Something related possibly with the new bubble chat…?

I had this issue and found the problem. The chat system is adding a " " to the end of every message. I tested this by making a for loop that prints each letter in the message sent from the chatted event. A printed result would be something like this: "1.h, 2.e, 3.l, 4.l, 5.o, 6. "
You can see it printed a 6th value which is a space and shouldnt be there

There are several threads relating to extra stuff in the Chatted Event–
This thread mentions chat and has many links to related threads:

This entry by @Criminimin has some interesting info:

However, the OP in this thread stated that Chatted was not fired at all (Different issues.)

Can confirm there is a carriage return character being added at the end of the string. I converted the messages to hex and found a 0D hex at the end. Until this is fixed you can easily gsub this out with the following:

string.gsub(msg, "[\n\r]" , "")

This removes new line and return characters, however the only one really needed for the carriage return is \r

Edit: Maybe I should have looked at that that thread lol. Looks like it was just patched while I was experimenting.

It looks like whatever was reverted from this post also ‘fixed’ this bug as well. @Tiffblocks

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