Hello, everyone!
I'm currently writing my own chat system, and I'm currently attempting to set up a chat filter. However, this only seems to work if there is one word involved ( that matches the accursed word. )
Any help would be much appreciated!
chatfilter = {}
chatfilter[1] = "badword"
s = "badword."
for w in string.gmatch(s, "%a+") do
if s == chatfilter[1] then
print("This message contained inappropiate content.")
else
print(s)
end
end

2 comments
Just one thing: How do I get it to filter a word no matter the capitalization?
I think you need to use "%a" but i'm not sure how to give match a pattern.