Gw8 Posted May 12, 2017 Posted May 12, 2017 (edited) por exemplo neste código: if pm == "!pm" then text = string.gsub(text,'!pm ','') text = string.gsub(text,'!pm','') local savedID = {} local savedTextPM = {} for pmText in string.gmatch(text,"(%a+)") do outputChatBox(pmText) if #savedID == 0 then table.insert(savedID,pmText) else table.insert(savedTextPM,savedTextPM) end end return privateMessage(source,savedID[1],table.concat(savedTextPM,"")) end nesta parte só obtêm letras, for pmText in string.gmatch(text,"(%a+)") do eu preciso que obtenha tudo e o texto ser separado por palavras tipo está assim no momento quando está sendo executado, !pm 1 oi tudo bom? salva assim oi tudo bom mas o correto que eu preciso é assim: 1 oi tudo bom? Edited May 12, 2017 by DNL291 Use a linguagem Lua para o código
DNL291 Posted May 12, 2017 Posted May 12, 2017 'text' retorna toda a mensagem? Tenta o seguinte, isto vai tirar do texto os caracteres "!pm ": local msg = text:sub( 5, #text ) if #msg > 1 then outputChatBox(msg) end Please do not PM me with scripting related question nor support, use the forums instead.
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