Ir para conteúdo

Alguem Poderia Me Esclarecer Uma Duvida?


lokind

Posts Recomendados

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>

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...