nasserdfdd Posted July 28, 2015 Posted July 28, 2015 ok so if any one could tell how to make script that would block a specfic word like an advertise to server for example if any one wrote CIF it would be ***
Buffalo Posted July 28, 2015 Posted July 28, 2015 Im using onClientChat for input detection. Theres a list of swear words: bWords = {["cfi"]=true,["msi"]=true} And check algorithm: function replaceBW(text,r,g,b) local changed = false local concat = split ( text, ' ' ) for i,v in ipairs(concat)do local testword = string.gsub(v,'%p','') --remove commas etc. if bWords[v] or bWords[string.lower(testword)] then concat[i] = string.rep('*',string.len(testword))..string.gsub(v,'%a','') changed = true end end if changed then cancelEvent() text = table.concat(concat,' ') outputChatBox(text,r,g,b,true) end end It's fast enough Words like CFIS will not be blocked tho cause of this check method simplicity and decency. Powered by Kimsufi© ☢ ZHP on Facebook ☢ ZHP on Youtube ☢ Support us ☢
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now