I'm awake, so here's what I made for you. If you only want kicking to happen, either leave the Banwords table empty, or delete between where it says ban begin and ban end.
Put this in lua\autorun\server\
KickWords = KickWords or {}
BanWords = BanWords or {}
KickWords = { --Add what words to be kickable.
"poohead", --Any added word should be in this format,
"muggle" --last word does NOT have a comma after it.
}
BanWords = { --Same rules as above, only for banning
"poopypants",
"nerfherder"
}
hook.Add( "PlayerSay", "Kick For Words", function(ply, text)
--Kick Begin--
for a,b in pairs(KickWords) do
if string.find(string.lower(text), b, 1, true) then --Is a word being used?
RunConsoleCommand("ulx", "kick", ply:Nick(), "Using a banned word.") --If yes, kick them
ulx.fancyLogAdmin( ply, true, "#A was kicked for saying the following: #s", text) --Tell admins they were kicked and what they said.
return "" --Return nothing so everyone can't read what was said.
end
end
--Kick End--
--Ban Begin--
for a,b in pairs(BanWords) do --Same as above, except for banning.
if string.find(string.lower(text), b, 1, true) then
RunConsoleCommand("ulx", "ban", ply:Nick(), "0", "Using a banned word.") --Ban time is set to 0 for perm, feel free to edit.
ulx.fancyLogAdmin( ply, true, "#A was banned for saying the following: #s", text)
return ""
end
end
--Ban End--
end )
Make sure your admins know what words are in the list and adhere to the rules. It looks bad if your admins are getting kicked for things like this.