Tenta esse:
function onUse(cid, item, topos, item2, frompos)
local myball = getPlayerSlotItem(cid, 8)
local boost = getItemAttribute(myball.uid, "boost") or 0
local boosts = 0
if boost == 300 then
doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.")
return true
end
if #getCreatureSummons(cid) >= 1 then
if getPlayerAccess(cid) == 6 then
boosts = 49
end
boosts = boosts + 1
local pokemon = getItemAttribute(myball.uid, "poke")
local off = pokes[pokemon].offense * boost_rate * boosts
local def = pokes[pokemon].defense * boost_rate * boosts
local agi = pokes[pokemon].agility * boosts
local spatk = pokes[pokemon].specialattack * boost_rate * boosts
local vit = pokes[pokemon].vitality * boost_rate * boosts
doSetItemAttribute(myball.uid, "boost", boost + boosts)
doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off)
doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def)
doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi)
doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk)
doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getThingPos(item2.uid), 103)
doPlayerSendTextMessage(cid, 27, "Congrulations, your "..pokemon..", as beem boosted +1.")
doPlayerSendTextMessage(cid, 27, "Now your "..pokemon.." have a boost +"..boosts + boost..".")
doSendAnimatedText(getThingPos(item2.uid), "+1 Boost", 215)
else
return doPlayerSendCancel(cid, "Only use in yours pokemons.")
end
return true
end