I think this should work.
Someone should correct me if it's wrong.
flameWords = {"fuck", "bitch", "cocksucker"}
function disallowFlame(message)
for key, value in pairs(flameWords) do
if string.find(string.lower(message), value) then
outputChatBox("YOU HAVE BEEN WARNED!",source) -- do whatever you want here
end
end
end
addEventHandler("onPlayerChat", getRootElement(), disallowFlame)