How to check if filtered text

Hello I just wanted to make a bio system
I wanna check if a string is filtered

game.ReplicatedStorage.Data.saveBio.Event:Connect(function(plr,text)
local Filtered = false
if Filtered == false then
biodata:SetAsync(plr.UserId,text)
end
end)

1 Like

please put three backticks for the code

```lua
-- put some code
```

and it becomes this:

-- put some code

also I would recommend putting this

local RepStorage = game:GetService("ReplicatedStorage")
RepStorage.Data.saveBio.Event:Connect(function(plr,text)
   local textFiltered = false
   if string.match(text, "#") then
      textFiltered = true
   else
      textFiltered = false
   end
   bioData:UpdateAsync(plr.UserId, function()
      return text
   end)
end)
3 Likes

your just checking if it cointains “#” in the text and the text is just what player typed in the bio

btw dont quit roblox and devforum just keep your thing up
I was at that stage until i made 110k robux so im sure if u try enough
u can be successful

If the user has to type it into a textbox, then you can use TextService to filter it.

You can use Text Filtering in TextService to filter the text then compare it from the original text to see if it was filtered.
Luau Strings are interned so you can do this via a simple conditional check.

local function isFiltered(inputText, filteredText)
    return inputText ~= filteredText
end

--usage example
textIsFiltered = isFiltered("test", "#est") --> true
textIsFiltered = isFiltered("test", "test") --> false
1 Like