Postado Julho 7, 2014 10 anos Autor Não testei, testa ai, sou novato se der certo da reputa se não der avisa qual foi o erro function onUse(cid) local storage = 88889 if getPlayerStorageValue(cid, storage) ~= 1 and getPlayerVocation(cid) == 7 and getPlayerLevel(cid) >= 110000 then doPlayerSetStorageValue(cid, storage, 1) doPlayerSetVocation(cid, 8) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns, você adquiriu sua vocação.") local param,config = string.lower(param),{pid = getPlayerGUID(cid),newlv = 30000,life = 30000,mana = 30000} elseif getPlayerStorageValue(cid, storage) == 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já fez essa quest.") elseif getPlayerVocation(cid) ~= 7 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem a vocação necessária.") elseif getPlayerLevel(cid) < 110000 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem level suficiente.") end return TRUE end Puts cara ele adicionou o vocation mas o level do player continuou. e quando eu sai do char e reloquei o vocation voltou pra tras.
Postado Julho 7, 2014 10 anos function onUse(cid) local storage = 88889 local param,config = string.lower(param),{pid = getPlayerGUID(cid),newlv = 30000,life = 30000,mana = 30000} if getPlayerStorageValue(cid, storage) ~= 1 and getPlayerVocation(cid) == 7 and getPlayerLevel(cid) >= 110000 then doPlayerSetStorageValue(cid, storage, 1) doPlayerSetVocation(cid, 8) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns, você adquiriu sua vocação.") elseif getPlayerStorageValue(cid, storage) == 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já fez essa quest.") elseif getPlayerVocation(cid) ~= 7 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem a vocação necessária.") elseif getPlayerLevel(cid) < 110000 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem level suficiente.") end return TRUE end Eu enxerguei meu erro, a variável que eu adicionei deve ser colocada como pre definida, ainda não sei se vai funcionar mais tenta ai pra gente ve "Que sobernos sejam nossos ideias Luzes no caminho de virtudes imortais, que estas sete velas sejam nossa lei o Brasão heroico da Vossa Ordem"
Postado Julho 7, 2014 10 anos Autor function onUse(cid) local storage = 88889 local param,config = string.lower(param),{pid = getPlayerGUID(cid),newlv = 30000,life = 30000,mana = 30000} if getPlayerStorageValue(cid, storage) ~= 1 and getPlayerVocation(cid) == 7 and getPlayerLevel(cid) >= 110000 then doPlayerSetStorageValue(cid, storage, 1) doPlayerSetVocation(cid, 8) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns, você adquiriu sua vocação.") elseif getPlayerStorageValue(cid, storage) == 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já fez essa quest.") elseif getPlayerVocation(cid) ~= 7 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem a vocação necessária.") elseif getPlayerLevel(cid) < 110000 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem level suficiente.") end return TRUE end Eu enxerguei meu erro, a variável que eu adicionei deve ser colocada como pre definida, ainda não sei se vai funcionar mais tenta ai pra gente ve esta aparecendo isso no meu distro quando dou use. [07/07/2014 00:02:38] [Error - Action Interface] [07/07/2014 00:02:38] data/actions/scripts/lonely.lua:onUse [07/07/2014 00:02:38] Description: [07/07/2014 00:02:38] data/actions/scripts/lonely.lua:5: bad argument #1 to 'lower' (string expected, got nil) [07/07/2014 00:02:38] stack traceback: [07/07/2014 00:02:38] [C]: in function 'lower' [07/07/2014 00:02:38] data/actions/scripts/lonely.lua:5: in function <data/actions/scripts/lonely.lua:1> e nao esta indo nada. Editado Julho 7, 2014 10 anos por victorleekrs (veja o histórico de edições)
Postado Julho 7, 2014 10 anos function onUse(cid) local param,config = string.lower(param),{pid = getPlayerGUID(cid),newlv = 30000,life = 30000,mana = 30000}local storage = 88889 if getPlayerStorageValue(cid, storage) ~= 1 and getPlayerVocation(cid) == 7 and getPlayerLevel(cid) >= 110000 then doPlayerSetStorageValue(cid, storage, 1) doPlayerSetVocation(cid, 8) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns, você adquiriu sua vocação.") elseif getPlayerStorageValue(cid, storage) == 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já fez essa quest.") elseif getPlayerVocation(cid) ~= 7 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem a vocação necessária.") elseif getPlayerLevel(cid) < 110000 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem level suficiente.") endreturn TRUEend Provavelmente não irá funcionar, não irei passar outras possibilidades de como realizar oque você quer para não roubar seu tempo, espere um especialista chegar eu sou apenas um novato em programação tibiana "Que sobernos sejam nossos ideias Luzes no caminho de virtudes imortais, que estas sete velas sejam nossa lei o Brasão heroico da Vossa Ordem"
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.