Only letting through certain words?

Hello, right, I need some help doing something, it’s a bit hard to explain so i’ll provide screenshots to help.

So, I have a massive table of words (200 words to be exact).

I also have a TextBox, where users can input text, obviously.

I also have a play button, and when this button is clicked it will check what text is inside of the textbox, if its something else other than the words in the table it will not let the player past, but if it does include a word from the table, it will let the player past and they can play the game…

This probably makes no sense but I tried my best to explain it.

if table.find(words, text_box.Text) then
    -- yes

Not much to say.


Would I just add an else if the word wasn’t allowed?

Yes you would add an else for running alternate logic in the case that it wasn’t allowed.

1 Like