[22/09/2018 22:11:59] [Error - Action Interface]
[22/09/2018 22:11:59] data/actions/scripts/Basic/order.lua:onUse
[22/09/2018 22:11:59] Description:
[22/09/2018 22:11:59] data/actions/scripts/Basic/order.lua:125: attempt to index field '?' (a nil value)
[22/09/2018 22:11:59] stack traceback:
[22/09/2018 22:11:59] data/actions/scripts/Basic/order.lua:125: in function <data/actions/scripts/Basic/order.lua:1>
É do DxP
Linha 125:
local thingName = doCorrectString(getCreatureName(item2.uid))if pokes[thingName].level > getPlayerLevel(cid)then
doSendMsg(cid,"Você não tem level para copiar este pok�mon.")returntrueend
O order.lua
function onUse(cid, item, frompos, item2, topos)if getCreatureCondition(cid, CONDITION_EXHAUST)or isWatchingTv(cid)thenreturntrueend
doAddCondition(cid, ordercondition)local pPos = getThingPos(cid)
pPos.stackpos =0local pos = getThingFromPos(pPos)if isSurf(cid)or isInArray(11756, item2.itemid)or item2.itemid ==11756or isInArray(11756, pos.itemid)or pos.itemid ==11756or isInArray({11756,11675,11676,460}, pos.itemid)thenreturn doPlayerSendCancel(cid, MSG_NAO_E_POSSIVEL)endif item2.uid == cid then-- demound pokeif isPlayer(item2.uid)and isInDuel(item2.uid)thenreturn doPlayerSendCancel(cid, MSG_NAO_E_POSSIVEL)endif isRiderOrFlyOrSurf(cid)thenlocal ball = getPlayerSlotItem(cid,8)
doGoPokemonInOrder(cid, ball,false)
doRemoveCondition(cid, CONDITION_OUTFIT)
doPlayerSay(cid, getCreatureNick(getCreatureSummons(cid)[1]).. orderTalks["downability"].talks[math.random(#orderTalks["downability"].talks)])
doRegainSpeed(cid)
setPlayerStorageValue(cid, orderTalks["ride"].storage,-1)
setPlayerStorageValue(cid, orderTalks["fly"].storage,-1)
doPlayerSendCancel(cid,'12//,show')returntrueendend--- ride/fly retiradaif isRiderOrFlyOrSurf(cid)thenreturn doPlayerSendCancel(cid, MSG_NAO_E_POSSIVEL)endif#getCreatureSummons(cid)==0thenreturn doPlayerSendCancel(cid,"Você precisa de um pokemon para usar o order.")endlocal poke = getCreatureSummons(cid)[1]local pokeName = getCreatureNick(poke)local habilidades = getPokemonSkills(getCreatureName(poke))if item2.uid == cid thenif isFight(cid)then-- Edição pra ficar igual pxg.. nao dar fly ou ride com fight
setMoveSummon(cid,false)
addEvent(doMovePokeToPos,5, poke, getThingPos(cid))returntrueendif isMega(poke)thenreturn doPlayerSendCancel(cid,"Pokemons megas não tem habilidades de fly/ride.")endif isPlayer(item2.uid)and(isInDuel(item2.uid)or getCreatureSkullType(item2.uid)== SKULL_WHITE or getCreatureSkullType(item2.uid)==1or getCreatureSkullType(item2.uid)==2)thenreturn doPlayerSendCancel(cid, MSG_NAO_E_POSSIVEL)endifnot(getThingPos(poke)or getThingPos(item2.uid))then-- correção de um erro.returntrueendlocal dist = getDistanceBetween(getThingPos(poke), getThingPos(item2.uid))--- rideif string.find(habilidades,"ride")then
doPlayerSay(cid, pokeName..orderTalks["ride"].talks[math.random(#orderTalks["ride"].talks)])if dist ==1then
doUp(cid, poke,"ride")returntrueend
setMoveSummon(cid,false)
addEvent(doMovePokeToPos,200, poke, topos)
setPlayerStorageValue(poke, orderTalks["ride"].storage,1)elseif string.find(habilidades,"fly")or string.find(habilidades,"levitate")thenif string.find(habilidades,"levitate")then
doPlayerSay(cid, pokeName..orderTalks["levitate"].talks[math.random(#orderTalks["levitate"].talks)])else
doPlayerSay(cid, pokeName..orderTalks["fly"].talks[math.random(#orderTalks["fly"].talks)])endif dist ==1then
doUp(cid, poke,"fly")returntrueend
setMoveSummon(cid,false)
addEvent(doMovePokeToPos,200, poke, topos)
setPlayerStorageValue(poke, orderTalks["fly"].storage,1)end----------------- Ditto -----------------elseif isMonster(item2.uid)and isInArray({"Shiny Ditto","Ditto"}, getItemAttribute(getPlayerSlotItem(cid,8).uid,"poke"))thenif isPlayer(item2.uid)and isInDuel(item2.uid)thenreturn doPlayerSendCancel(cid, MSG_NAO_E_POSSIVEL)endlocal listaproibidos ={"Mew","Mewtwo","Smeargle","Ho-oh","Moltres","Zapdos","Articuno"}if isInArray(listaproibidos, getCreatureName(item2.uid))then
doSendMsg(cid,"Seu ditto não pode se transformar nesse pokemon.")returntrueendif isPlayerSummon(cid, item2.uid)and isInArray({"Shiny Ditto","Ditto"}, getItemAttribute(getPlayerSlotItem(cid,8).uid,"poke"))andnot isInArray({"Shiny Ditto","Ditto"}, getItemAttribute(getPlayerSlotItem(cid,8).uid,"copyName"))then
doCopyPokemon(poke, getItemAttribute(getPlayerSlotItem(cid,8).uid,"poke"),true)
doPlayerSay(cid, getCreatureNick(getCreatureSummons(cid)[1])..", reverta-se.")returntrueelseifnot isPlayerSummon(cid, item2.uid)and getPokeName(item2.uid)~= getPokeName(poke)thenif isSummon(item2.uid)thenif getPlayerSlotItem(getCreatureMaster(item2.uid),8).uid ~=0and isInArray({"Shiny Ditto","Ditto"}, getItemAttribute(getPlayerSlotItem(getCreatureMaster(item2.uid),8).uid,"poke"))then
doSendMsg(cid,"Você não pode fazer uma copia de um outro ditto.")returntrueendendlocal thingName = doCorrectString(getCreatureName(item2.uid))if pokes[thingName].level > getPlayerLevel(cid)then
doSendMsg(cid,"Você não tem level para copiar este pok�mon.")returntrueend
doCopyPokemon(poke, thingName,true)returntrueend----------------- Mover -----------------elseifnot isCreature(item2.uid)then
setMoveSummon(cid,false)
doEreaseUsingOrder(poke)local oldTopos = getThingPos(item2.uid)local oldTopos_2 = topos
local x, y =0,0if(topos.x - getThingPos(poke).x)>0then
topos.x = topos.x +1elseif(topos.x - getThingPos(poke).x)<0then
topos.x = topos.x -1endif(topos.y - getThingPos(poke).y)>0then
topos.y = topos.y +1elseif(topos.y - getThingPos(poke).y)<0then
topos.y = topos.y -1end
setPlayerStorageValue(poke,505, getThingPos(cid).x)
setPlayerStorageValue(poke,506, getThingPos(cid).y)
addEvent(doMovePokeToPos,5, poke, topos)
doWalkAgain(poke)----- Edições dig/cut/rock smash/headbutt/blinklocal buracos ={468,481,483}local arvores ={2767}local pedras ={1285}local headbutt ={2707}if item2.uid ==0thenreturntrueendlocal pos = getThingPos(item2.uid)local dist = getDistanceBetween(getThingPos(poke), getThingPos(item2.uid))ifnot isFight(cid)then-- Edição pra ficar igual pxg.. nao dar fly ou ride com fightif isInArray(buracos, item2.itemid)then----------------------- DIGifnot string.find(habilidades,"dig")thenreturn doPlayerSendCancel(cid,"Esse pokemon não tem a habilidade de cavar.")end
doMarkedPos(poke, getThingPos(item2.uid))
doEreaseUsingOrder(cid)
setPlayerStorageValue(poke, orderTalks["dig"].storage,1)
setMoveSummon(cid,false)if dist ==1then
recheck(poke,"cut", getThingPos(item2.uid))else
addEvent(doMovePokeToPos,200, poke, topos)end
doPlayerSay(cid, getCreatureNick(poke)..orderTalks["dig"].talks[math.random(#orderTalks["dig"].talks)])returntrueelseif isInArray(arvores, item2.itemid)then----------------------- CUTifnot string.find(habilidades,"cut")thenreturn doPlayerSendCancel(cid,"Esse pokemon não tem a habilidade de cortar.")end
doMarkedPos(poke, getThingPos(item2.uid))
doEreaseUsingOrder(cid)
setPlayerStorageValue(poke, orderTalks["cut"].storage,1)
setMoveSummon(cid,false)if dist ==1then
addEvent(recheck,(1000-(2.3*getCreatureSpeed(poke)))* dist, poke,"cut", getThingPos(item2.uid))else
addEvent(doMovePokeToPos,200, poke, topos)end
doPlayerSay(cid, getCreatureNick(poke)..orderTalks["cut"].talks[math.random(#orderTalks["cut"].talks)])returntrueelseif isInArray(pedras, item2.itemid)then----------------------- ROCKifnot string.find(habilidades,"rock smash")thenreturn doPlayerSendCancel(cid,"Esse pokemon não tem a habilidade de quebrar.")endlocal pos = getThingPos(item2.uid)
doMarkedPos(poke, getThingPos(item2.uid))
doEreaseUsingOrder(cid)
setPlayerStorageValue(poke, orderTalks["rock"].storage,1)
setMoveSummon(cid,false)if dist ==1then
addEvent(recheck,(1000-(2.3*getCreatureSpeed(poke)))* dist, poke,"rock", getThingPos(item2.uid))else
addEvent(doMovePokeToPos,200, poke, topos)end
doPlayerSay(cid, getCreatureNick(poke)..orderTalks["rock"].talks[math.random(#orderTalks["rock"].talks)])returntrueelseif isInArray(headbutt, item2.itemid)then----------------------- HEADifnot string.find(habilidades,"headbutt")thenreturn doPlayerSendCancel(cid,"Esse pokemon não tem a habilidade de balancar arvores.")endlocal pos = getThingPos(item2.uid)
doMarkedPos(poke, getThingPos(item2.uid))
doEreaseUsingOrder(cid)
setPlayerStorageValue(poke, orderTalks["headbutt"].storage,1)
setMoveSummon(cid,false)if dist <=1then
addEvent(recheck,(1000-(2.3*getCreatureSpeed(poke)))* dist, poke,"headbutt", getThingPos(item2.uid))else
addEvent(doMovePokeToPos,200, poke, topos)end
doPlayerSay(cid, getCreatureNick(poke)..orderTalks["headbutt"].talks[math.random(#orderTalks["headbutt"].talks)])returntrueendendif string.find(habilidades,"blink")thenif os.time()< getPlayerStorageValue(poke, storages.blink)andnot isGod(cid)then
doPlayerSay(cid, getCreatureNick(poke)..orderTalks["move"].talks[math.random(#orderTalks["move"].talks)])returntrueelseif(getCreatureSkullType(cid)== SKULL_WHITE or isInDuel(cid))and getTileInfo(getThingPos(item2.uid)).protection then
doSendMsg(cid,"Você não pode usar blink em protection zone quando estiver em duelo.")returntrueend
setPlayerStorageValue(poke, storages.blink, os.time()+7)
doSendMagicEffect(getThingPos(poke),134)
doTeleportThing(poke, getThingPos(item2.uid),false)
doSendMagicEffect(getThingPos(poke),134)
doPlayerSay(cid, getCreatureNick(poke)..orderTalks["blink"].talks[math.random(#orderTalks["blink"].talks)])returntrueend
doPlayerSay(cid, getCreatureNick(poke)..orderTalks["move"].talks[math.random(#orderTalks["move"].talks)])endreturntrueendfunction isGhost(cid)local hab = getPokemonSkills(string.lower(getPokeName(cid)))if string.find(hab,"ghost")thenreturntrueendreturnfalseend
Pergunta
ceesar90 0
Boa noite. Estou sofrendo com esse erro:
É do DxP
Linha 125:
O order.lua
Alguém sabe por que?
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados