I have an example which disallows saying fuck
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if badword == nil then badword = {} end
function badword.censorword(id,txt,word)
t=string.lower(txt)
w=string.lower(word)
first = string.sub(w,1,1)
mid = string.sub(w,2,(string.len(w)-1))
last = string.sub(string.reverse(w),1,1)
midlen = string.len(mid)
string.gsub(w,"@","a") string.gsub(w,"5","s")
string.gsub(w,"!","i") string.gsub(w,"6","b")
string.gsub(w,"1","i") string.gsub(w,"7","t")
string.gsub(w,"2","r") string.gsub(w,"8","b")
string.gsub(w,"3","e") string.gsub(w,"9","q")
string.gsub(w,"4","a") string.gsub(w,"0","o")
string.gsub(w,"$","s")
if string.find(t,word)~=nil then
m = string.gsub(mid,mid,string.rep("*",midlen)
txt2 = string.gsub(t,w,(first..""..m..""..last)
msg(player(id,"name")..": "..txt2)
end
end
addhook("say","badword.say")
function badword.say(id,tx)
badword.censorword(id,txt,"fuck")
end
LUA Censoring Bad words
1 
Offline
TrialAndError