Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local addons = {
- [13562] = {pokemon= "Alakazam" , looktype = 2604, nome = "Red Addon"},
- [13471] = {pokemon= "Dragonite" , looktype = 2501, nome = "Dragon Addon", fly = 2500}
- }
- if #getCreatureSummons(cid) > 0 then
- doPlayerSendCancel(cid, "Please back your pokemon.")
- return false
- end
- if addons[item.itemid] then
- local numero = addons[item.itemid].looktype
- local fly = addons[item.itemid].fly
- local pb = getPlayerSlotItem(cid, 8).uid
- local pk = addons[item.itemid].pokemon
- local addonlook = addons[item.itemid].nome
- 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") < 1 then
- doRemoveItem(item.uid, 1)
- doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")
- doSetItemAttribute(pb,"addon",numero)
- doSetItemAttribute(pb,"addonfly",fly)
- doSetItemAttribute(pb,"addonlook",addonlook)
- return true
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement