I am using a callsign system in my game which allows players to enter a unique callsign for their player. Before assigning the callsign values, the server will filter the callsign to ensure it is allowed. If hashtags are found in the string after filtering, the system prompts the player to enter a different callsign.
After a player enters a blocked callsign, all the “different” callsigns (which are allowed) that come further are displayed as blocked. I am using the following server code to manage filtering.
filterStringEvent.OnServerInvoke = function(Player, textToFilter)
local filteredInstance = TextService:FilterStringAsync(textToFilter, Player.UserId, Enum.TextFilterContext.PublicChat)
local filteredText = filteredInstance:GetNonChatStringForUserAsync(Player.UserId)
Example of the problem:
You see that “420” was filtered like normal, however, all the numbers that follow should not be filtered.
EDIT: Here is the client code as well.
print("Callsign entered: " .. contentBox.Text) -- REMOVE
local filteredCallsign = filterString:InvokeServer(contentBox.Text)
print("Callsign filtered: " .. filteredCallsign) -- REMOVE
if string.find(filteredCallsign, "#") then
ReplicatedStorage.CreateNotification:FireServer("Failed", "This callsign has been blocked by the ROBLOX chat filter.")
Any ideas about what’s going on?
If you are testing this in studio, try testing it in the real game.
Yep, I’m aware. This still happens in the main game
Try using GetNonChatStringForBroadcastAsync Instead of GetNonChatStringForUserAsync. GetNonChatStringForBroadcastAsync doesn’t need any arguments btw.
Just tested it out, there is still no difference.
Have you tried it with words like ‘cat’ or ‘roblox’? some users might not be allowed to use numbers.
It works perfectly fine with strings, as intended. It only has this problem with numbers. I am the one testing it and my account is 13+ so it should let me input numbers.
I’m pretty sure it’s because people with <13 account aren’t allowed to use numbers, and even though you are 13+, there are some people who can’t use numbers, so it filters it out anyway.
no, that isnt true because the filter knows which user sent the message. However, I believe I have worked out the issue.
When you were testing your number, you used 420 first, which would be tagged. Then afterwards you used a different number, which should of worked but got tagged. I believe this is due to context. I tried 121 which worked fine, but after I filtered the same number again it got tagged. This is probably because the filter thought I was trying to spell out a phone number or some other type of PII.
Could you try to test a completely fine number first? I found that to reset the context filter to allow more numbers you can use a world such as ‘tree’.
I tried this, but it still didn’t seem to solve the problem.
very strange, im using the same server side code as you and it works fine for me. are you ceartin it’s not something to do with your account? go to your privacy settings https://www.roblox.com/my/account#!/privacy and make sure all these settings are enabled:
‘who can message me’ doesn’t matter, and it’s fine it’s set to custom or default. also make sure account restrictions are disabled.
Yeah, I have all those same settings. I tried the solution above where you make a request for a word like “tree” when a word gets filtered in an attempt to “reset” the filter. This worked 50/50 percent of the time. Not quite sure what’s going on.