Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. function onUse(cid, item, frompos, item2, topos)
  2. local chance = 70 -- chance de cortar
  3. local madeiras = {5941, 5901} -- item que o player irá ganhar
  4. local premio = madeiras[math.random(1, #madeiras)]
  5. local transformItem = 8786
  6. local texts = {"Tuc", "Toc", "Trec"}
  7. local random = texts[math.random(1,#texts)]
  8. local time = 1 -- Minutos para crescer novamente
  9. local outfit = 1248 -- ID da Outfit Male.
  10. local outfit2 = 1249 -- ID da Outfit Female.
  11.  
  12. if getPlayerSex(cid) == 1 then
  13. doSetCreatureOutfit(cid, {lookType = outfit}, 500) -- Tempo em que a outfit estará trocada.
  14. else
  15. doSetCreatureOutfit(cid, {lookType = outfit2}, 500) -- Tempo em que a outfit estará trocada.
  16. end
  17. doCreatureSetNoMove(cid, true)
  18. addEvent(function()
  19. if not isPlayer(cid) then return true end
  20. doCreatureSetNoMove(cid, false)
  21. end, 500)
  22.  
  23. if item2.itemid == 2702 or item2.itemid == 2703 or item2.itemid == 2704 or item2.itemid == 2705 or item2.itemid == 2706 then
  24. if math.random(1,100) >= chance then
  25. doPlayerAddItem(cid,premio, math.random(3, 7))
  26. doTransformItem(item2.uid, transformItem)
  27. doSendMagicEffect(topos, 584)
  28. doSendMagicEffect(frompos, 621)
  29. doSendAnimatedText(frompos, "Sucess", TEXTCOLOR_WHITE)
  30. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. .. " madeiras.")
  31. doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_WHITE)
  32. doDecayItem(item2.uid)
  33. addEvent(doCreateItem, time*60*1000, item2.itemid, 1, getThingPos(item2.uid))
  34. else
  35. doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_WHITE)
  36. doSendMagicEffect(topos, 584)
  37. doSendAnimatedText(frompos, "Fail", TEXTCOLOR_WHITE)
  38. end
  39. end
  40. return true
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement