All messages have an invisble newline appended to them, this breaks chat commands in my game. Happens 100% of the time online, started happening very recently.
Repro:
local TEST_MSG = "Testing"
local PlayersService = game:GetService("Players")
PlayersService.PlayerAdded:Connect(function(player)
print(player, "joined")
player.Chatted:Connect(function(msg)
-- Assuming you chatted "Testing"
print("Match test 1:", (msg == TEST_MSG)) -- false
print("Match test 2:", (msg == TEST_MSG.. string.char(13))) -- true
--print("player chatted: \"".. msg.. "\"")
--for x = 1, string.len(msg) do
-- print(x, string.byte(string.sub(msg, x, x)))
--end
end)
end)
Thought I’d add here, incase you need a quick solution, this should cover most cases: msg = string.gsub(msg, "\r", "")
This happens to me on an empty baseplate, as well as in 2 different places as well, live and in stuido. We were able to strip the end of the string to fix it ourselves, this is not our fault.
I just started a new baseplate, and surprisingly you’re right. This is odd, though, my already-existing .rbxl file and the new baseplate seem to differ.
I have no script editing happening to the chat, it’s pulling the Roblox defaults for the chat in both cases.
That shouldn’t be the case – I had no Studio sessions open until you made this post. Just in case, I’m exporting a copy of the chat from the Studio with the correct behavior. I’ll update when I get it imported into the default baseplate.
edit2: I just copy-pasted between studio sessions using the clipboard, and even after copy-pasting it does the same thing.
The issue is that this extra character is showing up after Roblox filters get applied. Roblox chat is supposed to strip out newline characters because of the potential for spamming, where people would just chat a whole bunch of newlines to “clear” the chatbox.
Yes, I just figured that out myself and have edited the title. This is also evident if you print the contents of a textbox, having “abc” and hitting enter between a/b results in “a\rbc”
It used to be that you could chat “hi/r/r/r/r/r/r/r/r/r/r/rlol” using Shift+Enter to type a carriage return and the result would be a chatbox that only had the line “lol” in it. People abused this. A lot. Trying the same thing, up until roughly an hour ago, would get you the result “hilol”.
Right now I frequently see blank messages where players want to type a message but change their mind and decide to cancel writing that message. Normally you could just hit enter on a blank chat field and Roblox’s default chat wouldn’t send the message, but now this carriage turn is pretty much defeating that purpose altogether.
For other input fields I use for things like controllers, I have to click outside the TextBox to avoid having the carriage turn put behind and it’s rather inconvenient since I’m used to hitting enter instead (I’m sure many of us are used to that too).
This update broke some core functionality in Tradelands but we’ve pushed out a quickfix stripping the suspect character before processing input.
This has also affected the behaviour of the core chat input. Previously, pressing enter without typing anything would cancel input. Now a blank message is sent regardless. Personally I often use the / key to free my mouse when locked to first person and then press enter to re-enter camera control, so this is very annoying - I don’t want to be spamming the chat with blank messages.
This is badly affecting my game which relies on chat messages to perform specific tasks. I am certain that this problem started occurring today. Please fix this ASAP.
This is from a blank fresh baseplate, invisible whitespace after every appended chat. I was wondering why my admin didn’t break but an older player commands did, the reason was, my admin splits strings via whitespace characters while the old player commands ran relying on subs.
I got pretty confused too when my entire admin script just broke out of nowhere with no edits done to the script before or after… until this is fixed my mods and admins are helpless against rule breakers and disruptive players.