However, I want to make a system where if the text the player inputs gets filtered at all, it gives a warning to the player, and tells them to try again, instead of letting their input go through with a bunch of hashtags.
Makes sense, but it didn’t tell me how to detect when a player’s input got filtered. E.G. think of cases where the player puts something inappropriate there, where hashtags would show, and cases where a player intentionally puts hashtags there for something like “#TaylorGang”
You could find the end of whatever word the hashtag is preceding. Here’s what I mean for example:
local input = …
local function wasFiltered(input: string)
local start = input.find("#")
local filtered = false
local endd = nil
for i = 1, input.Length do
if input.sub(i, i) == "#" then continue end
end = i
break
end
return (start ~= nil) and (endd ~= nil)
end
print(wasFiltered(input))
If Roblox filters something then I’d assume they’d filter a whole string
From my experience, ROBLOX is very inconsistent with filtering. Sometimes it will filter parts of the sentence, sometimes it will filter the whole damn thing.
Thats cause sometimes they hard-code filtering but I’m not sure theres a way to detect filtering besides having to replicate the whole filtering system and detect if it triggers, or just fire a remote event from the module itself when it filters something
then again, this is just my guess, and I honestly have no idea how the filtering modules work