Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. function onUse(cid, item, fromPosition, itemEx, toPosition)
  2. local addons = {
  3. [13562] = {pokemon= "Alakazam" , looktype = 2604, nome = "Red Addon"},
  4.  
  5. [13471] = {pokemon= "Dragonite" , looktype = 2501, nome = "Dragon Addon", fly = 2500}
  6.  
  7. }
  8.  
  9. if #getCreatureSummons(cid) > 0 then
  10. doPlayerSendCancel(cid, "Please back your pokemon.")
  11. return false
  12. end
  13. if addons[item.itemid] then
  14. local numero = addons[item.itemid].looktype
  15.  
  16. local fly = addons[item.itemid].fly
  17. local pb = getPlayerSlotItem(cid, 8).uid
  18. local pk = addons[item.itemid].pokemon
  19. local addonlook = addons[item.itemid].nome
  20.  
  21. if getItemAttribute(pb,"poke") ~= pk then
  22. doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.")
  23. return false
  24. end
  25.  
  26. if getItemAttribute(pb,"addon") < 1 then
  27. doRemoveItem(item.uid, 1)
  28. doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")
  29. doSetItemAttribute(pb,"addon",numero)
  30. doSetItemAttribute(pb,"addonfly",fly)
  31. doSetItemAttribute(pb,"addonlook",addonlook)
  32. return true
  33. end
  34. end
  35. return true
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement