How to tell if a string is the same as a string in a table

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”)

14 Likes

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:

1 Like

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.

Are you trying to make a text input for this?
Sort off a name system like?

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

115 Likes

Just a question, why are you making this?

2 Likes

I so badly want to search up myself there

9 Likes

Please keep us updated on it’s release (if you ever make it a public game. I need it to… check some people)

14 Likes

i gotta search myself if this gets released LOL

2 Likes

How far into this project are you? I’m very interested in this game…

2 Likes

Okay this got a lot more popularity than i expected!

The game should be done in a few days because I’m making a lot of progress. You can play the incomplete version right now:

I also made a game where you can get information on players:

It shows you related information other players have compared to you

23 Likes

Both of the games are sick, keep up the good work!

2 Likes

this is the Roblox experience ever

4 Likes

never have i laughed at a thread harder than this

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’)

7 Likes

Please tell us when this will be released this will be the greatest game to be created on this platform.

2 Likes

Check his response to me, he said about a week but the game is in beta right now

3 Likes

i might finish the game today because most of the stuff is now programmed. I work fast when i am motivated

2 Likes

Holy gigachad, this is literally god’s work.

5 Likes