how to use if statement

char = "a"
array = {"a", "b", "c", ...}

(how to code)
if char in array then

A very easy way to learn how to code something is to look at example code already posted in this forum. There is code for everything you’ll ever want to write. It will take you longer than if we give you the code you’re asking for, but while you’re looking, you’ll learn other things too.

I could tell you, but you need to know how find answers to language questions yourself.

Try googling “lua table contains item”