Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Bom amigo . Tinha alguns errinhos, mas acho que já consertei .

Testa ai e me fala.

 

Mostrar conteúdo oculto
local evo = {
                          
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(pokeball.uid, "hp", 1)
                    doItemSetAttribute(pokeball.uid, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    doTransformItem(pokeball.uid, balls[pokeball.itemid].newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
                 end
          end
end
return FALSE
end

Editado por Orochi Elf (veja o histórico de edições)

Tony Araújo  ;D 

 

  • Respostas 14
  • Visualizações 461
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
  • Autor
  Em 15/08/2014 em 01:30, Orochi Elf disse:

 

Bom amigo . Tinha alguns errinhos, mas acho que já consertei .

Testa ai e me fala.

 

Mostrar conteúdo oculto
local evo = {
                          
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(pokeball.uid, "hp", 1)
                    doItemSetAttribute(pokeball.uid, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    doTransformItem(pokeball.uid, balls[pokeball.itemid].newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
                 end
          end
end
return FALSE
end

 

Obrigado por tá tentado ajuda mais deu esse erro

[15/08/2014 09:05:30] [Error - Action Interface] 
[15/08/2014 09:05:30] data/actions/scripts/Shiny stone.lua:onUse
[15/08/2014 09:05:30] Description: 
[15/08/2014 09:05:30] data/actions/scripts/Shiny stone.lua:31: attempt to index field '?' (a nil value)
[15/08/2014 09:05:30] stack traceback:
[15/08/2014 09:05:30]  data/actions/scripts/Shiny stone.lua:31: in function <data/actions/scripts/Shiny stone.lua:13>
  Em 14/08/2014 em 21:48, diarmaint disse:

Me fala quais são os itens desses id's 

Mostrar conteúdo oculto

local balls = {

[2394] = {newBall = 2394},

[2391] = {newBall = 2391},

[2393] = {newBall = 2393},

[2392] = {newBall = 2392},

[12617] = {newBall = 12617},

vou tentar te ajudar se não conseguir pego o script de outro servidor.

Não precisa mexer são as balls do servidor

Postado
  • Solução

Teste assim agora.

 

Mostrar conteúdo oculto
local evo = {
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pokeball = getPlayerSlotItem(cid, 8)
 
if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
local monster = getCreatureName(itemEx.uid)
 
if not balls[pokeball.itemid] then
 
doPlayerSendCancel(cid, "Seu pokémon está em uma pokebola inválida.")
return true
end
 
if evo[monster] then
if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
 
doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
doSendMagicEffect(getThingPos(itemEx.uid), 18)
doRemoveCreature(itemEx.uid)
doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
doRemoveItem(item.uid, 1)
doSummonMonster(cid,evo[monster][1])
doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
doItemSetAttribute(pokeball.uid, "hp", 1)
doItemSetAttribute(pokeball.uid, "happy", 110)
local pk = getCreatureSummons(cid)[1]
doTransformItem(pokeball.uid, balls[pokeball.itemid].newBall)
adjustStatus(pk, pokeball.uid, true, false, true)
return TRUE
else
 
return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
end
end
end
return false
end

 
OBS: O Site tirou a identação do código.

Tony Araújo  ;D 

 

Postado
  • Autor
  Em 15/08/2014 em 12:23, Orochi Elf disse:
OBS: O Site tirou a identação do código.

só Postar como "code" 

 

irei testar aqui e jájá edito

 

edit, quando eu vou usar a stone diz isso ai 

Seu pokémon está em uma pokebola inválida.

Editado por TopllDanStar (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo