• Word Censor
    23 replies, posted
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.
[QUOTE=nicatronTg;19964221]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.[/QUOTE] lol Seriously, is that really annoying?
[QUOTE=DarkTyrael;19964600]lol Seriously, is that really annoying?[/QUOTE] It gets to you after a few hours.
[QUOTE=Entoros;19957058]I'd do something like this. *code with ipairs*[/QUOTE] [url=http://www.facepunch.com/showthread.php?t=875909] Why take the time to write that i?[/url]
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.
[QUOTE==HYDRO*PHOBIA=;19983379]Fuck the fucking word censor.[/QUOTE] What a rebel. So, did you ever get the script to work?
[QUOTE=Entoros;19983994]What a rebel. So, did you ever get the script to work?[/QUOTE] Nada.
[QUOTE=nicatronTg;19989831]Nada.[/QUOTE] 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.
[QUOTE=lilezek;19993275][QUOTE=nicatronTg;19989831]Nada.[/QUOTE] 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.[/QUOTE] Uhh, good for you? It's not going to be saying ***CENSORED*** or anything, it'll be something funny rather than "lol". I'll keep my opinion, you keep yours and we'll call it good. [QUOTE=samwilki;19995048][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.[/QUOTE] May I ask why you just took Entoros' code and replaced BanWord with CensoredWord? Anyhow, I'll try autorun/server instead.
[QUOTE=nicatronTg;20000395] May I ask why you just took Entoros' code and replaced BanWord with CensoredWord [/QUOTE] He considers it his own sweat and blood now.
No I don't, I thought ban word would meen you cant say the word, so I thought I would change it.
I might make a simple addon with a derma menu for adding censored words and stuff, just because I want to make something right now :v:
Sorry, you need to Log In to post a reply to this thread.