Tenta isso aí:
local a = {[12304] = {level = {1,5},balltype ="great",pokemons = {"Magby","Elekid","Marill","Cleffa"}}} local extrastrength = 1.1 function onUse(cid, item, frompos, item2, topos)local b = a[item.itemid] if not b then return true endlocal exhaust = 5 -- Em segundosif getPlayerStorageValue(cid, 556187) > os.time(t) then doPlayerSendCancel("You're exhausted.") doSendMagicEffect(getCreaturePosition(cid), 2) return trueelse setPlayerStorageValue(cid, 556187, os.time(t) + exhaust)end local pokemon = b.pokemons[math.random(#b.pokemons)]local pokeinfo = getPokemonStatus(pokemon)if not pokeinfo then return true endlocal btype = b.balltypeif not pokeballs[btype] then return true endlocal gender = getRandomGenderByName(pokemon)local level = math.random(b.level[1], b.level[2])local offense = pokeinfo.off * level * extrastrengthlocal defense = pokeinfo.def * level * extrastrengthlocal agility = pokeinfo.agi * level * extrastrengthlocal spatk = pokeinfo.spatk * level * extrastrengthlocal vit = pokeinfo.vit * level * extrastrengthlocal happy = 180local leveltable = getPokemonExperienceTable(pokemon) local ball = 0local sendToDepot = false if getCreatureMana(cid) >= 6 thensendToDepot = trueball = doCreateItemEx(2219)elseball = item.uidend doItemSetAttribute(ball, "poke", pokemon)doItemSetAttribute(ball, "hp", 1)doItemSetAttribute(ball, "level", level)doItemSetAttribute(ball, "exp", leveltable[level])doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])doItemSetAttribute(ball, "offense", offense)doItemSetAttribute(ball, "defense", defense)doItemSetAttribute(ball, "speed", agility)doItemSetAttribute(ball, "vitality", vit)doItemSetAttribute(ball, "specialattack", spatk)doItemSetAttribute(ball, "happy", happy)doItemSetAttribute(ball, "gender", gender)doItemSetAttribute(ball, "description", "Contains a "..pokemon..".")doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".") doPlayerSendTextMessage(cid, 27, "Seu egg está chocando!")doPlayerSendTextMessage(cid, 27, "E nasceu um[a] lindo[a] "..pokemon.." (level "..level.."), Parabéns!") if sendToDepot thendoPlayerSendMailByName(getCreatureName(cid), ball, 1)doTransformItem(ball, pokeballs[btype].on)doPlayerSendTextMessage(cid, 27, "Você está com 6 Pokémons na sua mochila, Seu novo Pokémon irá para o depósito da Cidade mais Próxima!.")doRemoveItem(item.uid)elsedoTransformItem(ball, pokeballs[btype].on)end doSendMagicEffect(getThingPos(cid), 29)return trueend
Tópico movido para a seção de dúvidas e pedidos resolvidos.


info
Grupo: Visconde
Registrado: 18/01/13
Posts: 319
Reputação: +66
Gênero: Masculino
local a = { [12304] = {level = {1,5},balltype ="great", pokemons = {"Magby","Elekid","Marill","Cleffa"}} } local extrastrength = 1.1 function onUse(cid, item, frompos, item2, topos) local b = a[item.itemid] if not b then return true end local pokemon = b.pokemons[math.random(#b.pokemons)] local pokeinfo = getPokemonStatus(pokemon) if not pokeinfo then return true end local btype = b.balltype if not pokeballs[btype] then return true end local gender = getRandomGenderByName(pokemon) local level = math.random(b.level[1], b.level[2]) local offense = pokeinfo.off * level * extrastrength local defense = pokeinfo.def * level * extrastrength local agility = pokeinfo.agi * level * extrastrength local spatk = pokeinfo.spatk * level * extrastrength local vit = pokeinfo.vit * level * extrastrength local happy = 180 local leveltable = getPokemonExperienceTable(pokemon) local ball = 0 local sendToDepot = false if getCreatureMana(cid) >= 6 then sendToDepot = true ball = doCreateItemEx(2219) else ball = item.uid end doItemSetAttribute(ball, "poke", pokemon) doItemSetAttribute(ball, "hp", 1) doItemSetAttribute(ball, "level", level) doItemSetAttribute(ball, "exp", leveltable[level]) doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level]) doItemSetAttribute(ball, "offense", offense) doItemSetAttribute(ball, "defense", defense) doItemSetAttribute(ball, "speed", agility) doItemSetAttribute(ball, "vitality", vit) doItemSetAttribute(ball, "specialattack", spatk) doItemSetAttribute(ball, "happy", happy) doItemSetAttribute(ball, "gender", gender) doItemSetAttribute(ball, "description", "Contains a "..pokemon..".") doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".") doPlayerSendTextMessage(cid, 27, "Seu egg está chocando!") doPlayerSendTextMessage(cid, 27, "E nasceu um[a] lindo[a] "..pokemon.." (level "..level.."), Parabéns!") if sendToDepot then doPlayerSendMailByName(getCreatureName(cid), ball, 1) doTransformItem(ball, pokeballs[btype].on) doPlayerSendTextMessage(cid, 27, "Você está com 6 Pokémons na sua mochila, Seu novo Pokémon irá para o depósito da Cidade mais Próxima!.") doRemoveItem(item.uid) else doTransformItem(ball, pokeballs[btype].on) end doSendMagicEffect(getThingPos(cid), 29) return true endJá tentei de várias formas
colocando Time
storage,
Eu gostaria que passa-se o tempo e ai que poderia abrir o item(ovo)
Valendo 10 Rep
Editado Setembro 8 por Soulviling