.Chatted Randomly Firing Twice in Public Experiences Only

I searched the forums for anything similar, I found this, but it wasn’t a bug report, just someone experiencing the same bug. .Chatted firing twice

Bug Report Details: When connecting a function to .Chatted, it’s possible for this to fire twice. I only encountered this recently because I use the .Chatted to scan for admin commands and one of them toggles a game option on and off. The toggle would seem to fail randomly, but after days of testing, finally figured it out it was actually firing twice. Once to turn on the feature and then again to turn it off thus making it seem like the command did nothing instead.

Where: Roblox Client

When: Random

Environment: Windows 10, 16GB of RAM or Windows 7 Pro, 16GB of RAM

Roblox Client Version: \AppData\Local\Roblox\Versions\version-72b95a99cfcf4b7d\RobloxPlayerBeta.exe

How to Reproduce: Attached a simple baseplate. All it does is connect a function to .Chatted and echo that back to the Client Log. You have to publish the baseplate and get some players into it to be able to reproduce it, usually takes about 5 players or more to get it to happen more often. You’ll know when it happens because you’ll see your Chat echoed twice in the client log. This never happens in Studio, so that’s why it took so long to track this down.
bug world demo.rbxl (49.5 KB)

24 Likes

I’ve noticed this also happening in some of my games that have client based chat commands, it’s been happening at least for a couple of weeks. (I thought I was going crazy and my scripts were wrong lol)

3 Likes

Can confirm this happens, my chat commands most of the time fire twice.

2 Likes

This is also happening in my experience for some of my players. The Chatted event is firing twice which makes a bunch of my chat commands unusable (as they’re toggle ones)

1 Like

This is a workaround example I posted in another topic, but doesn’t fix the issue at hand.

-- Local Player Chat Commands
local debounceDelay = false

localPlayer.Chatted:Connect(function(sChatCommand)
	if debounceDelay == true then
		return
	end
	
	debounceDelay = true

	-- Some code that does what you want goes in between
	if string.lower(sChatCommand) == ":cpu" then
		-- Toggle CPU Display Blah Blah
	end

	task.wait(0.5) -- Wait in case of double firing
	debounceDelay = false
end)
1 Like

Roblox needs to fix this ASAP, i’ve used my own “patcher” where its just a debunce if the messages are the same as the previous one but this doesn’t help since server latency & player ping cause the timer to be exceeded letting it double chat sometimes which is annoying

1 Like

My expierence is also receiving this issue. Anytime someone types in chat, it results in a secondary message being sent due to the issue.

We are working on alternatives to resolve the issue on our end, but would appreciate ROBLOX intervention.

1 Like

We are also still experiencing this on a multitude of our games (over 10), in our radio systems, this is severely detrimental for us, since our radios only have a certain number of slots available for past messages.

We are looking into implementing workarounds but with so many games with slightly differing radio systems, this will be a lot of effort.

(edit) all of these games use the old lua chat system

2 Likes

it’s not that hard to fix this

local previousMessage;
player.Chatted:Connect(function(msg)
if previousMessage == msg then return end

previousMessage = msg;

-- do ur stuff here
end)
1 Like

It’s not that it’s inherently hard to fix, but the fact that we’d need to go through games that haven’t had updates in over a year (that are still used by our community).
Anyway, finding workarounds is kind of pointless since it’s a bug that causes, in a lot of cases, merely visual issues with systems such as radios (that’s all that’s been reported by our users). I was more surprised seeing that this was first reported almost a month ago.

1 Like

This issue is still occurring within an experience I develop for and is very infuriating. Even after implementing a debounce that checks for the same message… it still fires twice (for whatever reason)!

Not sure what is going on behind the engine but I am begging for the engineers to check this out and give it their time as it is affecting many experiences that rely on the Chatted event for custom chat UIs.

Edit (after confirmation that this isn’t going to be fixed): If you’re calling some async function within the event then implement your debounce logic there for an interim solution as I had to figure out myself, if not, then you’ll be forced to use the new TextChatService API

4 Likes

Having this issue as well, I went crazy trying to find out why

1 Like

Bug is causing quite a lot of issues for my game, this needs fixing ASAP.

1 Like

Hey everyone, found someone internally to take a look. Hang tight!

4 Likes

This is still happening, really annoying, messes with commands in my game a lot, annoyingly, there’s a pretty significant delay (0.15 seconds) between the two times it gets fired, so you need a long debounce to prevent it.

1 Like

I can confirm that this appears to still be an issue.
Users of my recently released Radio System are also reporting the same bug within games that use LegacyChatService and I can’t recreate the issue within studio.

Here’s our most recent report of this just about an hour ago from this post.

2 Likes

I have a feeling this may not get a lot of attention with Roblox because the new chat system, in regards to chat commands, eliminates this problem because you don’t need the .chatted event anymore. It has a built in chat command creation system that does not need to know what the player chats to perform the commands. Because of this, it was a push for me to finally migrate to the new chat system. :melting_face:

2 Likes

I don’t think roblox will ever fix this issue.
Legacy ChatService kinda got left off

2 Likes

Still experiencing this, affecting my custom chat modifications.

1 Like

Still occurring, any update on this?

1 Like