LO

Alguem Poderia Me Esclarecer Uma Duvida?

Por lokind, 27 de jan. de 2012 em Archived

script
3
521
lokindL
27 de janeiro de 2012 às 15:33

Em um Script aki Eu nao Consigo localizar o erro:

local function doPokemonRegisterLevel(cid)

if not isCreature(cid) then return true end

if getWildPokemonLevel(cid) == -1 then

if not pokes[getCreatureName(cid)].offense then

doRemoveCreature(cid)

return true

end

setWildPokemonLevel(cid)

end

end

 

local function doSetRandomGender(cid)

if not isCreature(cid) then return true end

local gender = 0

local name = getCreatureName(cid)

if not newpokedex[name] then return true end

local rate = newpokedex[name].gender

if rate == 0 then

gender = 3

elseif rate == 1000 then

gender = 4

elseif rate == 1000 then

gender = 0

elseif math.random(1, 1000) <= rate then

gender = 4

 

else

gender = 3

end

doCreatureSetSkullType(cid, gender)

end

 

function onSpawn(cid)

 

registerCreatureEvent(cid, "GeneralConfiguration")

registerCreatureEvent(cid, "DirectionSystem")

registerCreatureEvent(cid, "CastSystem")

 

if isSummon(cid) then

registerCreatureEvent(cid, "SummonDeath")

return true

end

 

registerCreatureEvent(cid, "Experience")

 

addEvent(doPokemonRegisterLevel, 5, cid)

addEvent(doSetRandomGender, 5, cid)

 

return true

end

 

e o Erro:

 

27/01/2012 15:18:09] [Error - CreatureScript Interface]

[27/01/2012 15:18:09] In a timer event called from:

[27/01/2012 15:18:09] data/creaturescripts/scripts/spawn.lua:-onSpawn

[27/01/2012 15:18:09] Description:

[27/01/2012 15:18:09] data/creaturescripts/scripts/spawn.lua:4: attempt to index field '?' (a nil value)

[27/01/2012 15:18:10] stack traceback:

[27/01/2012 15:18:10] data/creaturescripts/scripts/spawn.lua:4: in function <data/creaturescripts/scripts/spawn.lua:1>

 

bepokemonB
27 de janeiro de 2012 às 15:59

Deve estar faltando a table: poke

Ou então ele não está conseguindo pegar o nome do pokémon .. o.O'

lokindL
27 de janeiro de 2012 às 16:15

mas tipo vc poderia reformulalo para mim tentar conseguir faser pegar ja tentei de tudo para arrumar mas nao vai