Kick player for saying "lag"

It makes me rage when someone says “LAAAAAGGGGGG”, so I’m requesting a simple script where a player gets kicked for saying lag with reason "Instakicked for saying “lag”

Well well… Can’t you make it so it only recognizes “lag”, and doesn’t kick if a word includes the letters l a g.

Honestly, I don’t think this is a good idea. First of all, anyone can bypass this by changing a letter. Then some legit conversations about lag on other servers would be stopped. If it annoys you that much, consider banning people manually everytime they scream lag.

[lua]
hook.Add( “PlayerSay”, “Coverup”,function( ply, text)
if string.find(string.lower(text), “lag”) then
ply:Kick(“You Have been kicked to cover up the fact the server is lagging”)
end
end)
[/lua]

string.find, mate.

Done :3

How to add multiple words, like “lagg laagg laggg” etc.

[lua]
local KickWords = {}
table.insert(KickWords, “lag”)
table.insert(KickWords, “laag”)
table.insert(KickWords, “laaag”)
hook.Add( “PlayerSay”, “Coverup”,function( ply, text)
for k,v in pairs(KickWords) do
if string.find(string.lower(text), v) then
ply:Kick(“You Have been kicked to cover up the fact the server is lagging”)
end
end
end)[/lua]
Untested.

Thank you.

You’re welcome :smile:

[lua]local KickWords = {
“^la+g+", "^la+g+%W", "%Wla+g+”,
“%Wla+g+%W”,
“%Wla+gg”,
“^la+gg”,
“gay penis sex”
}

hook.Add( “PlayerSay”, “Coverup”,function( ply, text)
for k,v in pairs(KickWords) do
if string.find(string.lower(text), v) then
ply:Kick(“You Have been kicked to cover up the fact the server is lagging”)
end
end
end)[/lua]

I’m not really a pattern guy so there are probably cleaner ways to do it, but it should get rid of must lag related stuff such as “laaagggggg”, “lag”, “lagging”, “laggy”, while still allowing stuff such as “flag”.

I still think kicking for saying such words is really stupid.

[editline]04:38PM[/editline]

“My good sir, I believe your server has severely high latency”

They can shout latency, but saying “lag” is somehow bothering me.

“Sorry, I had to shut down Skype because it was lagging my whole computer down”

You should break the loop after the kick, otherwise if it finds more matches then it’ll try and use a NULL entity.

This server really laaa-ggg-sss!

epic