The problem is that you instead of getting the actual "Value" of the table, you were getting the numerical value of the table, try this,
IllegalPhrases = {"banana"}
Message = "banana lol"
for _,word in pairs(IllegalPhrases) do
local Word
if word:sub(1,1) ~= " " then Word = " "..word:lower() else Word = word:lower() end
if word:sub(#word) ~= " " then Word = Word.." " end
if Message:lower():find(Word) then
print("Bad keyword: "..Word:sub(1,#Word-1)) return
elseif Message:lower():sub(1,#Word-1) == Word:sub(1) then
print("Bad keyword: "..Word:sub(1)) return
end
end
|