Hey guys I’m trying to detect if certain words are in sentences with my chat filter. I have a table of words I want to be banned and I have the message. (You don’t have to worry about the way I’m getting the msg. I have it under control.) I’m using string. split() in the message so that them not putting spaces won’t bypass.
here’s the code:
local msg = VUser
local banned_words = {"furry", "tail", "fursuit", "ears", "fluffy", "shark", "cat", "wolf", "hound", "fox", "bunny", "timber"}
local EdittedMsg = string.split(msg, "")
for i,v in pairs(EdittedMsg) do
if table.find(banned words, string.lower(v)) then
print("banned word")
end
end
I want an advanced system that can’t be bypassed by no spaces. For example: FurryCat will bypass string.Find(banned_words, v) but i want it so that it doesn’t
as you can see I don’t know how to figure out if each one of those individual letters makes up a banned word so that’s what I need help with
In order to make FurryCat banned I’m thinking I make the script completely ignore spaces. How I would do this is do string.split() for every letter to be seperate and therefore I can make it ignore spaces.
what I have right now is the start but I’m not sure how to combine those singular letters to find banned words without accidentally creating banned words from unrelated things
(unrelated that shouldnt get banned: Carl Ate Tates which could be flagged for “Cat”)
Damn dude, those are some filtered word list you got there well. well anyways. you can use table.find and string.match.
Edit: you can use this solution here it’s far better:
I’m looking at his script and I’m having trouble getting a bool on whether the msg is banned or not. In this post it replaces the msg but what I want is to get a true/false Boolean on whether it is banned
Why would you use a boolvalue for banned words? i’m confused on what you’re trying to do here (Ignoring the fact you’re filtering animal species). The solution i posted filters custom words whilst ignoring spacing.
You see my entire issue is actually a little more complex than I explained. It is not filtering bad words but it’s the exact same system.
I’m basically checking if a players name is a certain thing and I would need a Boolean to tell whether its a certain thing. Replacing the players name is dumb because it would be useless for my situation since I’m just checking if the players name is a certain thing.
It’s a furry detector game that tells you if the player is a furry by searching their inventory, badges, favorites, games, assets, decals, audios, and checking their username/displayname
anyways, dont edit the message; string.find will do the work without it, as you are sending each character individually to be checked (tl;dr: you are checking ‘c’ against ‘cat’)