TopllDan
Football <3
- Joined
- May 14, 2015
- Messages
- 66
- Reaction score
- 0
Hello boost has a stone in my server that is a bug and I hope you help me
I have a stone to use in Pokémon, it's normal functioning the only problem is that no matter where I give use the item, type if I click on the item and use goes down the effect will work on pokemon that are in the slot.
But I wanted the stone effect only worked if I used the item in the ball and not how it is that I can use on anything that the effect works on pokemon that is the main slot
script boost stone
when I'm using anywhere and do not have pokemon in the main slot give this error ai
I have a stone to use in Pokémon, it's normal functioning the only problem is that no matter where I give use the item, type if I click on the item and use goes down the effect will work on pokemon that are in the slot.
But I wanted the stone effect only worked if I used the item in the ball and not how it is that I can use on anything that the effect works on pokemon that is the main slot
script boost stone
Code:
function onUse(cid, item, fromPosition, item2, toPosition)
local myball = getPlayerSlotItem(cid, 8)
local boost = getItemAttribute(myball.uid, "boost") or 0
local boosts = 10
if boost == 70 then
doPlayerSendCancel(cid, "Seu pokemon está no lvl máximo.")
return true
end
if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid, "Retorne seu pokemon para poder usar a boost stone.")
end
if getPlayerSlotItem(cid, 8).uid <= 0 then
return doPlayerSendCancel(cid, "Seu pokemon não está no slot principal.")
end
boosts = boosts
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
newBoost = boost + boosts
if newBoost > 70 then
newBoost = 70
end
doSetItemAttribute(myball.uid, "boost", newBoost)
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, "Parabéns, o seu "..pokemon..", foi bostado +"..boosts..".")
doPlayerSendTextMessage(cid, 27, "Agora, o seu "..pokemon.." está bostado +"..newBoost..".")
doSendAnimatedText(getThingPos(item2.uid), "+"..boosts.." Boost", 215)
return true
end
when I'm using anywhere and do not have pokemon in the main slot give this error ai
Code:
[31/07/2015 18:29:45] [Error - Action Interface]
[31/07/2015 18:29:45] data/actions/scripts/booststone.lua:onUse
[31/07/2015 18:29:45] Description:
[31/07/2015 18:29:45] (luaGetItemAttribute) Item not found
[31/07/2015 18:29:54] [Error - Action Interface]
[31/07/2015 18:29:54] data/actions/scripts/booststone.lua:onUse
[31/07/2015 18:29:54] Description:
[31/07/2015 18:29:54] (luaGetItemAttribute) Item not found