Postado Março 22, 2015 10 anos Autor Tenta usar a action assim: function onUse(cid, item, frompos, item2, topos) local config = { repNeeded = 5000 } if rep.getPoints(cid) >= config.repNeeded then pos = getPlayerPosition(cid) if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendTextMessage(cid,22,'Stay in front of the door.') return 1 end doTeleportThing(cid,pos) doSendMagicEffect(topos,12) else doPlayerSendTextMessage(cid,22,"Only players with " .. config.repNeeded .. " reputation can open the chest.") end return TRUE end E no final do seu mod falta fechar a função <mod, não sei se está assim no seu também, se estiver coloque </mod> na ultima linha do script. O erro persiste, mas mudou pouca coisa nele. [21/03/2015 22:35:43] [Error - Action Interface] [21/03/2015 22:35:43] data/actions/scripts/rep/rep2.lua:onUse [21/03/2015 22:35:43] Description: [21/03/2015 22:35:43] data/actions/scripts/rep/rep2.lua:6: attempt to index global 'rep' (a nil value) [21/03/2015 22:35:43] stack traceback: [21/03/2015 22:35:43] data/actions/scripts/rep/rep2.lua:6: in function <data/actions/scripts/rep/rep2.lua:1> Quanto ao mod, eu esqueci de copiar, mas ele está fechado sim. ps: os scripts so mudam os valores, ou seja, o rep5 que coloquei no spoil da action é igual ao rep2 do erro.
Postado Março 22, 2015 10 anos Solução Mude isso if getRepPoints(cid) >= config.repNeeded then pra isso if getPoints(cid) >= config.repNeeded then Ou mude o nome da função no MOD. Caso não funcione, adicione isso em lib/0-50function.lua function getRepPoints(cid) -- Rep System local Info = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") local p = Info:getDataInt("rep") Info:free() return p end Editado Março 22, 2015 10 anos por joadson (veja o histórico de edições) Te ajudei? Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta" Skype: JoadsonAion
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.