String replace

Floceo

Новичок
Автор темы
13
0
Версия MoonLoader
.027.0-preview
the question is how can I remove the words "Click a" from a string
Exemple: var afk captured the string "Clique em um(a) Torre de energia"
I would need to replace all that to keep just "Torre de energia"
but the words after the string like "Torre de energia" are random


Code:
        if sampTextdrawIsExists(2113) then
            afk = sampTextdrawGetString(2113)
        end
 

Floceo

Новичок
Автор темы
13
0
Lua:
local afk = "Clique em um(a) Torre de energia"
local afk_new = afk:match("Clique em um%(a%) (.+)")
print(afk_new) --output: Torre de energia
and in the case in Brazil we have accented words, when the word has, for example, "ç" or "ã" it doesn't work, how could I do it in this case?
such as apple, which in Brazil would be "Maçã"