Ir para conteúdo

Posts Recomendados

Salve galera, recentemente achei um servidor perdido na net e estou dando uma fuçada nele porem estou com um erro que quando uso a Pokedex em mim me retorna este erro:

[Error - Action Interface]
data/actions/scripts/pokedex.lua:onUse
Description:
data/actions/scripts/pokedex.lua:36: attempt to index field '?' (a number value)
stack traceback:
        data/actions/scripts/pokedex.lua:36: in function <data/actions/scripts/pokedex.lua:3>

 

O script da Pokedex:

local rate = 20

function onUse(cid, item, fromPos, item2, toPos)
 
if not isCreature(item2.uid) then
return true
end

local poke = getCreatureName(item2.uid)

	if isMonster(item2.uid) then
       local this = newpokedex[getCreatureName(item2.uid)]
	   local myball = 0
	   if isSummon(item2.uid) then
	      myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
       end
       if not getPlayerInfoAboutPokemon(cid, poke).dex then
	      local exp = this.level * rate
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked "..getCreatureName(item2.uid).." in your pokedex!")
	      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
          doSendMagicEffect(getThingPos(cid), 210)
          doPlayerAddExperience(cid, exp)
          doAddPokemonInDexList(cid, poke)
       else
          doShowPokedexRegistration(cid, item2, myball)
       end
	return true
	end

if not isPlayer(item2.uid) then return true end

	local kanto = 0
	local johto = 0
                                    --alterado v1.7 \/\/
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
		   if i <= 151 then
              kanto = kanto+1
           elseif i >= 209 then
              johto = johto+1
           end
		end
	end                                                      --alterado v1.6

	local player = getRecorderPlayer(toPos, cid)

	if cid == player then
	    doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.") 
        doPlayerSetVocation(cid, 9) --alterado v1.6
        openChannelDialog(cid)
	end

return true
end

 

Se alguém puder me ajudar ❤️

Link para o comentário
https://xtibia.com/forum/topic/247712-encerrado-erro-ao-usar-pokedex-em-si-mesmo/
Compartilhar em outros sites

local rate = 20

function onUse(cid, item, fromPos, item2, toPos)
 
if not isCreature(item2.uid) then
return true
end

local poke = getCreatureName(item2.uid)

	if isMonster(item2.uid) then
       local this = newpokedex[getCreatureName(item2.uid)]
	   local myball = 0
	   if isSummon(item2.uid) then
	      myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
       end
       if not getPlayerInfoAboutPokemon(cid, poke).dex then
	      local exp = this.level * rate
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked "..getCreatureName(item2.uid).." in your pokedex!")
	      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
          doSendMagicEffect(getThingPos(cid), 210)
          doPlayerAddExperience(cid, exp)
          doAddPokemonInDexList(cid, poke)
       else
          doShowPokedexRegistration(cid, item2, myball)
       end
	return true
	end

if not isPlayer(item2.uid) then return true end

	local kanto = 0
	local johto = 0
                                   --alterado v1.7 \/\/
	if (not oldpokedex or #oldpokedex <=0) then return end
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
		   if i <= 151 then
              kanto = kanto+1
           elseif i >= 209 then
              johto = johto+1
           end
		end
	end                                                      --alterado v1.6

	local player = getRecorderPlayer(toPos, cid)

	if cid == player then
	    doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.") 
        doPlayerSetVocation(cid, 9) --alterado v1.6
        openChannelDialog(cid)
	end

return true
end

 

Link para o comentário
https://xtibia.com/forum/topic/247712-encerrado-erro-ao-usar-pokedex-em-si-mesmo/#findComment-1741777
Compartilhar em outros sites

  Em 27/06/2018 em 14:18, Crypter disse:
local rate = 20

function onUse(cid, item, fromPos, item2, toPos)
 
if not isCreature(item2.uid) then
return true
end

local poke = getCreatureName(item2.uid)

	if isMonster(item2.uid) then
       local this = newpokedex[getCreatureName(item2.uid)]
	   local myball = 0
	   if isSummon(item2.uid) then
	      myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
       end
       if not getPlayerInfoAboutPokemon(cid, poke).dex then
	      local exp = this.level * rate
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked "..getCreatureName(item2.uid).." in your pokedex!")
	      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
          doSendMagicEffect(getThingPos(cid), 210)
          doPlayerAddExperience(cid, exp)
          doAddPokemonInDexList(cid, poke)
       else
          doShowPokedexRegistration(cid, item2, myball)
       end
	return true
	end

if not isPlayer(item2.uid) then return true end

	local kanto = 0
	local johto = 0
                                   --alterado v1.7 \/\/
	if (not oldpokedex or #oldpokedex <=0) then return end
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
		   if i <= 151 then
              kanto = kanto+1
           elseif i >= 209 then
              johto = johto+1
           end
		end
	end                                                      --alterado v1.6

	local player = getRecorderPlayer(toPos, cid)

	if cid == player then
	    doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.") 
        doPlayerSetVocation(cid, 9) --alterado v1.6
        openChannelDialog(cid)
	end

return true
end

 

Expand  

Continua o mesmo erro, eu retirei esta parte do script para ver se funcionava:

	if (not oldpokedex or #oldpokedex <=0) then return end
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
		   if i <= 151 then
              kanto = kanto+1
           elseif i >= 209 then
              johto = johto+1
           end
		end
	end  

E funciona normalmente, porem sem a contagem de quantos pokemons tem na dex..

Editado por Genzo
Link para o comentário
https://xtibia.com/forum/topic/247712-encerrado-erro-ao-usar-pokedex-em-si-mesmo/#findComment-1741796
Compartilhar em outros sites

da uma visada 1° se tem a tabela oldpokedex ta certinha no seu lib/configuration.lua 

e testa esse aqui: 

  Mostrar conteúdo oculto

 

Editado por Gabrieltxu
Link para o comentário
https://xtibia.com/forum/topic/247712-encerrado-erro-ao-usar-pokedex-em-si-mesmo/#findComment-1741800
Compartilhar em outros sites

Help , to com erro tbm , se eu usar a pokedex em mim mesmo , da esse erro na distro , ou se usar em player tbm da erro , como faria pra bloquea essa açao ?

 

[29/06/2018 01:51:52] [Error - Action Interface] 
[29/06/2018 01:51:52] data/actions/scripts/pokedex.lua:onUse
[29/06/2018 01:51:52] Description: 
[29/06/2018 01:51:52] data/actions/scripts/pokedex.lua:58: attempt to index a boolean value
[29/06/2018 01:51:52] stack traceback:
[29/06/2018 01:51:52]     data/actions/scripts/pokedex.lua:58: in function <data/actions/scripts/pokedex.lua:3>
 

Link para o comentário
https://xtibia.com/forum/topic/247712-encerrado-erro-ao-usar-pokedex-em-si-mesmo/#findComment-1741807
Compartilhar em outros sites

  • 7 months later...
A questão neste suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
https://xtibia.com/forum/topic/247712-encerrado-erro-ao-usar-pokedex-em-si-mesmo/#findComment-1748467
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...