• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Pokedex Error onUse

ssewok

New Member
Joined
Oct 1, 2011
Messages
29
Reaction score
0
When i want to use the pokedex on myself to check the pokedex it self it gives me this error
Code:
[19/01/2016 17:22:23] [Error - Action Interface]
[19/01/2016 17:22:23] data/actions/scripts/pokedex.lua:onUse
[19/01/2016 17:22:23] Description:
[19/01/2016 17:22:23] data/actions/scripts/pokedex.lua:36: attempt to index a boolean value
[19/01/2016 17:22:23] stack traceback:
[19/01/2016 17:22:23]     data/actions/scripts/pokedex.lua:36: in function <data/actions/scripts/pokedex.lua:3>

I could use some help to fix this
 
Here is the code

Code:
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
 
Back
Top