Tô trabalhando num addon system, meu servidor usar icones, e eu acho que ele não tá reconhecendo a pokebola
script:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addons = {
[17132] = {pokemon= "Snorlax" , looktype = 1895, fly = 0, ride = 0, surf = 0},
}
if #getCreatureSummons(cid) > 0 or isRiderOrFlyOrSurf(cid) then
doPlayerSendCancel(cid, "Please back your pokemon.")
return false
end
local addon = addons[item.itemid].looktype
local fly = addons[item.itemid].fly
local ride = addons[item.itemid].ride
local surf = addons[item.itemid].surf
local pb = getPlayerSlotItem(cid, 8).uid
local pk = addons[item.itemid].pokemon
if getItemAttribute(pb,"poke") ~= pk then
doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.")
return false
end
if getItemAttribute(pb,"addon") >= 0 then
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")
doSetItemAttribute(pb,"addon",addon)
doSetItemAttribute(pb,"addonfly",fly)
doSetItemAttribute(pb,"addonride",ride)
doSetItemAttribute(pb,"addonsurf",surf)
return true
end
return true
end
tag:
<action itemid="17132" event="script" value="addon.lua"/>
alguém consegue me ajudar nisso? por favor!