Postado Maio 30, 2015 10 anos Kra, nao Funcionou... Nenhum dos 2 Scripts! Pronto local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 500) 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)) 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)) doAddCondition(cid, condition) 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 resolvido? se sim clique em melhor resposta ~~ Editado Maio 30, 2015 10 anos por TopllDanStar (veja o histórico de edições)
Postado Maio 31, 2015 10 anos Mano... Infelizmente nao Funcionou tbm :/ 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)) 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)) setCreatureMaxHealth(cid, getCreatureMaxHealth(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) end return true end se não funciona mim diga a base do seu servidor ~~ Editado Maio 31, 2015 10 anos por TopllDanStar (veja o histórico de edições)
Postado Maio 31, 2015 10 anos Nao Funcionou e eu Uso Base PDA Testei em servidor PDA ~~ 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 addHealth = 500 -- (Vida que vai heala do Pokemon) 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 local summons = getCreatureSummons(cid) if(table.maxn(summons) > 0) then -- no summons else doPlayerSendCancel(cid, "You don't have any summons.") return true end if boost >= cfg.boost_fail then if math.random(1, 100) <= cfg.chance then 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) 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)) doCreatureAddHealth(getCreatureSummons(cid)[1], addHealth) 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 31, 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.