I am releasing a script to stop players from writing words you do not like.
Players with chatfilter:bypass ace are ignored and still allowed to enter forbidden words.
Configuration
-- what should happen when someone enteres a bad word
-- "delete": delete the message
-- "kick": kick the player and delete the message
local mode = "delete"
-- kick message (if 'mode' is set to 'kick')
local kickmessage = "Swearing is not allowed."
-- blacklisted words (in lowercase)
local blacklist = {
"some",
"example",
"words"
}
WARNING: This script is not compatible with other chat-scripts like my AutoReply-System.
If you block the word example, players will not be able to write exxample, exam.ple, ex@mple, exampl3 and many other aliases.
It seems the script has problems with words that have double letters in them, like for example “lesser” or “logger”, etc. It is the “if(char ~= lastchar)” condition that is causing this problem. One solution is to add an iteration counter (i) that you increment in the loop and change the if statement to “if(i < string.len(finalmessage))”.