Carontee

Untitled

Feb 6th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.33 KB | None | 0 0
  1. --[[  Esse é o script do piggy bank
  2.    SCRIPT BY CARONTE
  3.  visite: tibiaking.com
  4.                                
  5.  
  6.  
  7. function onUse(cid, item, frompos, item2, topos)
  8.  
  9. rand1 = math.random(1,100)
  10. rand2 = math.random(1,70)
  11. rand3 = math.random(1,15)
  12.  
  13. local dinheiro = 5  -- Quantide de crystal coins que irá consumir
  14. local chancedequebrar = 0 -- porcentagem da chance de se quebrar, use 0 para não quebrar
  15.  
  16.  
  17.  
  18. dinheiro = dinheiro * 10000
  19. if getPlayerMoney(cid) >= dinheiro then
  20. doPlayerRemoveMoney(cid, dinheiro)
  21. else
  22. doCreatureSay(cid, '~You need '..dinheiro..' golds to break it !!!~', TALKTYPE_ORANGE_1)
  23. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  24. return false
  25. end
  26.  
  27. if rand1 <= 50 then
  28. doPlayerAddItem(cid,2148,rand1)
  29.     doCreatureSay(cid, '~Holy Shit !!! only '..rand1..' golds, my mom will kill me~', TALKTYPE_ORANGE_1)
  30.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
  31.         end
  32. if rand1 >= 51 and rand1 <= 70  then
  33. doPlayerAddItem(cid,2152,rand3)
  34.     doCreatureSay(cid, '~Oh-oh '..rand3..' Platinum coins!, would i try again ?~', TALKTYPE_ORANGE_1)
  35.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_BLUE)
  36.         end
  37. if rand1 >= 90 then
  38. doPlayerAddItem(cid,2160,rand2)
  39.     doCreatureSay(cid, '~Oh My God! :D '..rand2..' Crystal coins !!!', TALKTYPE_ORANGE_1)
  40.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_WATERSPLASH)
  41. end
  42.    
  43. if rand1 <= chancedequebrar then
  44. doPlayerAddMoney(cid, dinheiro)
  45. doTransformItem(item.uid,item.itemid+1)
  46. end
  47.  
  48. return 1
  49. end
  50.  
  51. ]]
  52.  
  53. function onUse(cid, item, frompos, item2, topos)
  54.  
  55. local chance = math.random(1,2)
  56. dinheiro = 10 -- Quantidade mínima para jogar
  57.  
  58.  
  59. dinheiro = dinheiro * 10000
  60. crystalparaapostar = dinheiro / 10000
  61.  
  62. if
  63.     getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= 2160 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid ~= 2160 then
  64.         doCreatureSay(cid, 'You need money in your hand to play', TALKTYPE_ORANGE_1)
  65.  
  66.  
  67. elseif
  68.     getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 2160 and getPlayerSlotItem(cid, CONST_SLOT_LEFT).count < 10 then
  69.     doCreatureSay(cid, 'You dont have '..crystalparaapostar..' crystal coins enough to play', TALKTYPE_ORANGE_1)
  70. elseif 
  71.  
  72.     getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == 2160 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).count < 10 then
  73.     doCreatureSay(cid, 'You dont have '..crystalparaapostar..' crystal coins enough to play', TALKTYPE_ORANGE_1)
  74.    
  75. end
  76.  
  77. if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 2160 and getPlayerSlotItem(cid, CONST_SLOT_LEFT).count >= 10 or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == 2160 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).count >= 10 then
  78. doCreatureSay(cid, 'Its time to play', TALKTYPE_ORANGE_1)
  79. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  80.  
  81.  
  82.  
  83.  
  84.  end
  85.  return true
  86.  end
  87.  
  88. --[[     Esse é a continuação "
  89.  
  90. if getPlayerSlotItem(cid, CONST_SLOT_LEFT) or getPlayerSlotItem(cid, CONST_SLOT_RIGHT) == ITEM_GOLD_COIN >= dinheiro then
  91.  
  92. if chance == 1 then
  93. doPlayerRemoveMoney(cid, dinheiro)
  94. doCreatureSay(cid, 'Here is a gift to you', TALKTYPE_ORANGE_1)
  95. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  96.  
  97. else chance == 2 then
  98. doPlayerAddMoney(cid, dinheiro * 2)
  99. doCreatureSay(cid, '~You need '..dinheiro..' golds to break it !!!~', TALKTYPE_ORANGE_1)
  100. end
  101.  
  102. end
  103.  
  104.  
  105.  
  106.  
  107. return true
  108. end
  109. ]]
Advertisement
Add Comment
Please, Sign In to add comment