Word Censor

I’m looking for a script that would censor a certain set of words if a player said them, and replace them with 1 word. Anyone?

  1. Are you 12 ?

  2. You mean if he said them then it would say something like ( this server does not allow theys words) or ( I am a 9 year old who doesnt want to see bad words :0 )

  3. I think I may have seen something like this so I will try to find it for you.

Why are you considering that he’s a 12 year old just because he wants a script that makes certain words banned?

Believe it or not but not everyone wants to see profane words pop up on their screen.

Penis.
Back to the subject
I see TF2 servers with censors, so I just use ä ü Ö Ü Å to get around it.

I’d do something like this.

[lua]local censors = {}

local function BanWord( word, replace )
censors[word] = replace
end

BanWord( “yall”, “you guys” )
BanWord( “coke”, “Pepsi” )

hook.Add(“PlayerSay”,“Censorship”,function(pl,text,toall)
local ret = “”
for _,v in ipairs( string.Explode(" ",text) ) do
local rep = censors[string.lower(v)]
local s = v
if rep then s = rep end
ret = ret … s … " "
end
return ret
end)[/lua]

EDIT: Doesn’t work sorry.

Where do you put the file?

Uhh, for original usage, it’s because we’re sick and tired of around 10 people constantly spamming the chat with “lol” after each and every single line. Here’s an example:

*Blah was killed by prop_physics
Blah: lol
Jim: lol
Tom: lol

The idea is that we can replace it with something a little less annoying.

Thanks Entoros, testing now.

lol

Seriously, is that really annoying?

It gets to you after a few hours.

Why take the time to write that i?

Yes I’ve seen the speed analysis, but it came about a year after I started in Lua so it’s force of habit.

Plus, I’m not dealing with tables of > 100,000 keyvalues, so ipairs still wins (even if the difference is negligible).

Sorry for a late reply, but it’s not working in /autorun/ or /autorun/server/. Would it be considered clientside?

Check assmod, It has a Word Censorer.

I just took my code from ASSMod, I remember getting it going before now it doesn’t, and it should work I just tryed it.

Fuck the fucking word censor.

What a rebel.

So, did you ever get the script to work?

Nada.

Dude, if you annoy lol word, just request those don’t say it.
Is more annoying the censor system than words…

By the way, from my point of view, if you annoy words, you have a mental problem.

[lua]local censors = {}

local function CensoredWord( word, replace )
censors[word] = replace
end

CensoredWord( “hi”, “hello” )
CensoredWord( “fuck”, “fudge” )
CensoredWord( “shit”, “poo” )

hook.Add(“PlayerSay”,“Censorship”,function(pl,text,toall)
local ret = “”
for _,v in ipairs( string.Explode(" ",text) ) do
local rep = censors[string.lower(v)]
local s = v
if rep then s = rep end
ret = ret … s … " "
end
return ret
end)[/lua] I got that guys working, just put that in autorun/server.