[23/06/2012 15:59:25] [Error - Action Interface]
[23/06/2012 15:59:25] data/actions/scripts/pokedex.lua:onUse
[23/06/2012 15:59:25] Description:
[23/06/2012 15:59:26] data/actions/scripts/pokedex.lua:44: attempt to index a boolean value
[23/06/2012 15:59:26] stack traceback:
[23/06/2012 15:59:26] 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
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
info
Grupo: Artesão
Registrado: 19/05/11
Posts: 109
Reputação: +4
ERRO:
SCRIPT: