isa_Khamdan Posted August 3, 2013 Share Posted August 3, 2013 Hello , I have tag system with a function that replace bad words in the list with "*" but I want to change it so it remove the whole text and replace it with another text like when you say you are bitch it will remove the whole text and replace it with "Insult isn't allowed" That's the code addEventHandler("onPlayerChat", getRootElement(), function(text, msgtype) local result = SQLS3D.qury("SELECT * FROM Tags_System") if ( type ( result ) == "table" and #result == 0 or not result ) then return end local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local new = "" local iter = 0 msg = string.gsub(text,"ـ","") for word in msg:gmatch("%S+") do iter = iter + 1 for i,swr in ipairs(words) do local src = word:lower():gsub("%s","") local src = src:gsub("#%x%x%x%x%x%x","") local src = src:gsub("%c","") local src = src:gsub("%p","") local pat = swr:lower():gsub("%s","") if src:find(pat) then local replaceString = "" for x=1,word:gsub("#%x%x%x%x%x%x",""):len() do replaceString = replaceString.."*" end word = word:gsub(word,replaceString) end end if iter == 1 and word:len() > 2 then word = word:gsub("%a",string.upper,1) end new = new..word.." " end Link to comment
isa_Khamdan Posted August 3, 2013 Author Share Posted August 3, 2013 using freeroam? No Link to comment
-.Paradox.- Posted August 3, 2013 Share Posted August 3, 2013 Ok, i sent my script in pm, check it if there is an error tell me. Link to comment
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