Carontee

Untitled

Feb 6th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. --[[  Esse é o script do piggy bank
  2.    SCRIPT BY CARONTE
  3.  visite: tibiaking.com  
  4.                                
  5.  
  6. function onUse(cid, item, frompos, item2, topos)
  7.  
  8. rand1 = math.random(1,100)
  9. rand2 = math.random(1,70)
  10. rand3 = math.random(1,15)
  11.  
  12. local dinheiro = 5  -- Quantide de crystal coins que irá consumir
  13. local chancedequebrar = 0 -- porcentagem da chance de se quebrar, use 0 para não quebrar
  14.  
  15.  
  16.  
  17. dinheiro = dinheiro * 10000
  18.  
  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.      
  33.       if rand1 >= 51 and rand1 <= 70  then
  34.         doPlayerAddItem(cid,2152,rand3)
  35.         doCreatureSay(cid, '~Oh-oh '..rand3..' Platinum coins!, would i try again ?~', TALKTYPE_ORANGE_1)
  36.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_BLUE)
  37.       end
  38.      
  39.       if rand1 >= 90 then
  40.          doPlayerAddItem(cid,2160,rand2)
  41.          doCreatureSay(cid, '~Oh My God! :D '..rand2..' Crystal coins !!!', TALKTYPE_ORANGE_1)
  42.          doSendMagicEffect(getCreaturePosition(cid), CONST_ME_WATERSPLASH)
  43. end
  44.    
  45.     if rand1 <= chancedequebrar then
  46. doPlayerAddMoney(cid, dinheiro)
  47. doTransformItem(item.uid,item.itemid+1)
  48. end
  49.  
  50. return 1
  51. end
Advertisement
Add Comment
Please, Sign In to add comment