I need to check user inputs like abcde but FilterStringAsync is tagging them as a bad word which they are not.
I tested and put Hello abcde inside the Roblox chat and it didn’t get tagged
Result
It is tagging Hello abcde that I am FilterStringAsync to check if it is a bad word (my script)
In Roblox Chat Result
Why this filtering is not consistent?
Is this a bug?
or am I implementing this incorrectly?
Code I am using
local rs = game:GetService("ReplicatedStorage")
local TextService = game:GetService("TextService")
local remote = rs.Remote
function t(player)
local toCheck = "Hello abcde"
local filteredResult
local filteredTextObject
local success, errormessage = pcall(function()
filteredTextObject = TextService:FilterStringAsync(toCheck, player.UserId)
end)
print(success)
if success then
local worked, errormessage2 = pcall(function()
filteredResult = filteredTextObject:GetNonChatStringForBroadcastAsync()
end)
if worked then
if string.match(filteredResult, "#") then
print("# Detected " .. filteredResult)
else
print("Result is good: " ..filteredResult)
end
end
end
end
remote.OnServerEvent:Connect(t)