I'm kinda falling asleep atm, so It's bed time. Here's what I have for you, a modification of what I posted before on another thread. I made censorship into one variable, if you want to change that tell me and I'll look at it in the morning. Everything else is straightforward.
lua\autorun\server
KickWords = KickWords or {}
KickWords.words = {
"lolipop",
"damndude",
"corecheng",
"prinnies"
}
KickWords.admins = false --Kick Admins?
KickWords.sadmins = false --Kick Superadmins?
KickWords.censor = true --Censor words?
hook.Add( "PlayerSay", "Meanie Head", function(ply, text)
local oldtext = text --Remember what they said, for admins sake
for a,b in pairs(KickWords.words) do
if string.find(string.lower(text), b, 1, true) then --Is a word being used?
if KickWords.censor then text = "I said a bad word...." end --What to print if censored.
if (ply:IsAdmin() and not KickWords.admins) or (ply:IsSuperAdmin() and not KickWords.sadmins) then return text end--Tie it all into one line
RunConsoleCommand("ulx", "kick", ply:Nick(), "You Meanie!") --If yes, kick them
ulx.fancyLogAdmin( ply, true, "#A was kicked for saying the following: #s", oldtext or text) --Tell admins they were kicked and what they said.
return text --Return nothing so everyone can't read what was said.
end
end
end )