Ir para conteúdo
  • 0

Ajuda Action Erro Pokedex


Pergunta

ERRO:

 

 

[25/06/2012 11:20:54] [Error - Action Interface]

[25/06/2012 11:20:54] data/actions/scripts/pokedex.lua:onUse

[25/06/2012 11:20:54] Description:

[25/06/2012 11:20:54] data/actions/scripts/pokedex.lua:44: attempt to index a boolean value

[25/06/2012 11:20:54] stack traceback:

[25/06/2012 11:20:54] data/actions/scripts/pokedex.lua:44: in function <data/actions/scripts/pokedex.lua:3>

 

SCRIPT:

 

local rate = 20
function onUse(cid, item, fromPos, item2, toPos)

if not isCreature(item2.uid) then
return true
endlocal poke = getCreatureName(item2.uid)
if isMonster(item2.uid) thenlocal this = newpokedex[getCreatureName(item2.uid)]
local leveltable = getPokemonExperienceTable(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, leveltable)
 end
return true
endif not isPlayer(item2.uid) then return true end
local unlock = 0for i = 1, #oldpokedex do
 if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
 unlock = unlock + 1
 end
end
local str = ""
local lnl = 0
local poks = ""
local player = getRecorderPlayer(toPos, cid)
for x = 1001, 1251 do
 local y = tonumber(x - 1000)
 if getPlayerInfoAboutPokemon(player, oldpokedex[y][1]).dex then
  if isPokemonInOwnList(player, oldpokedex[y][1]) then
str = str.."\n["..threeNumbers(y).."] - "..oldpokedex[y][1].."   (•)"
lnl = lnl + 1
  else
str = str.."\n["..threeNumbers(y).."] - "..oldpokedex[y][1]..""
  end
 else
  str = str.."\n["..threeNumbers(y).."] -  ?"
 end
endif cid == player then
 doPlayerSendTextMessage(cid, 27, "You can open a pokedex entry by typing \"/dex <name>\". Example: \"/dex Pikachu\".")
 str = "Pokédex Information:\n\n- Unlocked pokémon species: "..unlock.."\n- Pokémon species that you own: "..lnl.."\n\n(•) means that you have already used that pokémon species.\n\nPokémon Database:\n"..str..""
  if string.len(str) <= 8192 then
doShowTextDialog(cid, 2382, str)
  end
else
 doPlayerSendTextMessage(cid, 27, getPlayerName(player).." has unlocked "..unlock.."/251 pokémons already, and has captured "..lnl.." pokemons until now.")
endreturn true
end

 

 

existe alguma tag para eloe nao reportar o erro no distro?

Link para o comentário
https://xtibia.com/forum/topic/188707-ajuda-action-erro-pokedex/
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

O script ta meio embaralhado com uns "end" junto de "if" e algumas colocações erradas, então só o indentei. Vê se funfa:

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 leveltable = getPokemonExperienceTable(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, leveltable)
   end
return true
end
if not isPlayer(item2.uid) then
   return true
end
local unlock = 0
for i = 1, #oldpokedex do
   if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
       unlock = unlock + 1
   end
end
local str = ""
local lnl = 0
local poks = ""
local player = getRecorderPlayer(toPos, cid)
for x = 1001, 1251 do
   local y = tonumber(x - 1000)
   if getPlayerInfoAboutPokemon(player, oldpokedex[y][1]).dex then
       if isPokemonInOwnList(player, oldpokedex[y][1]) then
           str = str.."\n["..threeNumbers(y).."] - "..oldpokedex[y][1].."   (•)"
           lnl = lnl + 1
       else
           str = str.."\n["..threeNumbers(y).."] - "..oldpokedex[y][1]..""
       end
   else
       str = str.."\n["..threeNumbers(y).."] -  ?"
   end
end
if cid == player then
   doPlayerSendTextMessage(cid, 27, "You can open a pokedex entry by typing \"/dex <name>\". Example: \"/dex Pikachu\".")
   str = "Pokédex Information:\n\n- Unlocked pokémon species: "..unlock.."\n- Pokémon species that you own: "..lnl.."\n\n(•) means that you have already used that pokémon species.\n\nPokémon Database:\n"..str..""
   if string.len(str) <= 8192 then
       doShowTextDialog(cid, 2382, str)
   end
else
   doPlayerSendTextMessage(cid, 27, getPlayerName(player).." has unlocked "..unlock.."/251 pokémons already, and has captured "..lnl.." pokemons until now.")
end
return true
end

Link para o comentário
https://xtibia.com/forum/topic/188707-ajuda-action-erro-pokedex/#findComment-1284545
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...