Postado Maio 27, 2015 10 anos Eu usei um script q n dava tributo nenhum, ai adicionei umas tags e começou a adicionar uns tributo! vê se este funfa: function onUse(cid, item, frompos, item2, topos) local cfg = { qnt = 1, --Quantos boosts o pokémon irá receber. max = 50, --Boost máximo do seu servidor. chance = 5, --Chance de falhar, em % boost_fail = 10, --A partir de quantos boosts poderá falhar. } local myball = getPlayerSlotItem(cid, 8).uid local summon = getCreatureSummons(cid)[1] local boost = getItemAttribute(myball, "boost") or 0 if myball <= 0 then return doPlayerSendCancel(cid, "Coloque um pokémon no Main Slot!") elseif #getCreatureSummons(cid) <= 0 then return doPlayerSendCancel(cid, "Você precisa estar usando seu pokémon para conseguir boostá-lo!") elseif boost >= cfg.max then return doPlayerSendCancel(cid, "Seu pokémon já se encontra no nível máximo de boost!") end if boost >= cfg.boost_fail then if math.random(1, 100) <= cfg.chance then dosetItemSetAttribute(myball, "boost", (boost + cfg.qnt)) doSetItemAttribute(myball.uid, "boost", boost + boosts) doSetItemAttribute(myball.uid, "boosting", 1) --alterado v1.9.1 doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokémon avançou do nível [+"..tonumber(boost).."] de boost para o nível [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) else doSendAnimatedText(getThingPos(summon), "Fail!", 215) doPlayerSendTextMessage(cid, 27, "Sua boost stone falhou!") doRemoveItem(item.uid, 1) end else doItemSetAttribute(myball, "boost", (boost + cfg.qnt)) doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokémon avançou do nível [+"..tonumber(boost).."] de boost para o nível [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) end return true end Editado Maio 27, 2015 10 anos por Summer Slyer (veja o histórico de edições) Pokémon Dust Evolution É aonde começa sua nova aventura!! Facebook Verifique Atualizações
Postado Maio 28, 2015 10 anos teste assim function onUse(cid, item, frompos, item2, topos) local cfg = { qnt = 1, --Quantos boosts o pokémon irá receber. max = 15, --Boost máximo do seu servidor. chance = 2, --Chance de falhar, em % boost_fail = 9, --A partir de quantos boosts poderá falhar. } local myball = getPlayerSlotItem(cid, 8).uid local summon = getCreatureSummons(cid)[1] local boost = getItemAttribute(myball, "boost") or 0 if myball <= 0 then return doPlayerSendCancel(cid, "Coloque um pokemon no Main Slot!") elseif #getCreatureSummons(cid) <= 0 then return doPlayerSendCancel(cid, "Voce precisa estar usando seu pokemon para conseguir boosta-lo!") elseif boost >= cfg.max then return doPlayerSendCancel(cid, "Seu pokemon ja se encontra no nivel maximo de boost!") end if boost >= cfg.boost_fail then if math.random(1, 100) <= cfg.chance then doItemSetAttribute(myball, "boost", (boost + cfg.qnt)) addEvent(doCreatureAddHealth, 500, back, hp-maxHp) doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokemon evoluiu do nivel [+"..tonumber(boost).."] de boost para o nivel [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) else doSendAnimatedText(getThingPos(summon), "Fail!", 215) doPlayerSendTextMessage(cid, 27, "Sua boost stone falhou!") doRemoveItem(item.uid, 1) end else doItemSetAttribute(myball, "boost", (boost + cfg.qnt)) doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokemon evoluiu do nivel [+"..tonumber(boost).."] de boost para o nivel [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) end return true end
Postado Maio 28, 2015 10 anos Autor Nao Funcionou e Ainda deu Erro na Distro: [28/05/2015 19:37:34] [Error - Action Interface] [28/05/2015 19:37:34] data/actions/scripts/booststone.lua:onUse [28/05/2015 19:37:34] Description: [28/05/2015 19:37:34] data/actions/scripts/booststone.lua:25: attempt to perform arithmetic on global 'hp' (a nil value) [28/05/2015 19:37:34] stack traceback: [28/05/2015 19:37:34] data/actions/scripts/booststone.lua:25: in function <data/actions/scripts/booststone.lua:1>
Postado Maio 29, 2015 10 anos Nao Funcionou e Ainda deu Erro na Distro: desculpe é porque estou sem servidor para testar aqui :\ function onUse(cid, item, frompos, item2, topos) local cfg = { qnt = 1, --Quantos boosts o pokémon irá receber. max = 15, --Boost máximo do seu servidor. chance = 2, --Chance de falhar, em % boost_fail = 9, --A partir de quantos boosts poderá falhar. } local myball = getPlayerSlotItem(cid, 8).uid local summon = getCreatureSummons(cid)[1] local boost = getItemAttribute(myball, "boost") or 0 if myball <= 0 then return doPlayerSendCancel(cid, "Coloque um pokemon no Main Slot!") elseif #getCreatureSummons(cid) <= 0 then return doPlayerSendCancel(cid, "Voce precisa estar usando seu pokemon para conseguir boosta-lo!") elseif boost >= cfg.max then return doPlayerSendCancel(cid, "Seu pokemon ja se encontra no nivel maximo de boost!") end if boost >= cfg.boost_fail then if math.random(1, 100) <= cfg.chance then doItemSetAttribute(myball, "boost", (boost + cfg.qnt)) doCreatureAddHealth(cid, 500) doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokemon evoluiu do nivel [+"..tonumber(boost).."] de boost para o nivel [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) else doSendAnimatedText(getThingPos(summon), "Fail!", 215) doPlayerSendTextMessage(cid, 27, "Sua boost stone falhou!") doRemoveItem(item.uid, 1) end else doItemSetAttribute(myball, "boost", (boost + cfg.qnt)) doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokemon evoluiu do nivel [+"..tonumber(boost).."] de boost para o nivel [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) end return true end ou teste esse function onUse(cid, item, frompos, item2, topos) local cfg = { qnt = 1, --Quantos boosts o pokémon irá receber. max = 15, --Boost máximo do seu servidor. chance = 2, --Chance de falhar, em % boost_fail = 9, --A partir de quantos boosts poderá falhar. } local myball = getPlayerSlotItem(cid, 8).uid local summon = getCreatureSummons(cid)[1] local boost = getItemAttribute(myball, "boost") or 0 local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid) if myball <= 0 then return doPlayerSendCancel(cid, "Coloque um pokemon no Main Slot!") elseif #getCreatureSummons(cid) <= 0 then return doPlayerSendCancel(cid, "Voce precisa estar usando seu pokemon para conseguir boosta-lo!") elseif boost >= cfg.max then return doPlayerSendCancel(cid, "Seu pokemon ja se encontra no nivel maximo de boost!") end if boost >= cfg.boost_fail then if math.random(1, 100) <= cfg.chance then doItemSetAttribute(myball, "boost", (boost + cfg.qnt)) doItemSetAttribute(myball, "hp", 500) doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokemon evoluiu do nivel [+"..tonumber(boost).."] de boost para o nivel [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) else doSendAnimatedText(getThingPos(summon), "Fail!", 215) doPlayerSendTextMessage(cid, 27, "Sua boost stone falhou!") doRemoveItem(item.uid, 1) end else doItemSetAttribute(myball, "boost", (boost + cfg.qnt)) doSendAnimatedText(getThingPos(summon), "+1 BOOST", 215) doPlayerSendTextMessage(cid, 27, "Seu pokemon evoluiu do nivel [+"..tonumber(boost).."] de boost para o nivel [+"..tonumber(boost + 1).."].") doRemoveItem(item.uid, 1) end return true end Editado Maio 29, 2015 10 anos 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.