Hydorax

Chest

Oct 7th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. options:
  2.     procent: 10
  3.     item1: diamond
  4.     item2: dirt
  5.     item3: wood
  6.     item4: diamond sword
  7.     item5: enchanted golden apple
  8.     item6: 5 diamond
  9.     item7: 8 diamond
  10.     item8: 11 diamond
  11.     item9: diamond of infinity 10
  12.     item10: 30 egg
  13.     item11: 1 gold block
  14.     item12: diamond axe of efficiency 4 and sharpness 5 named "&7Tomahawk"
  15.     item13: diamond pickaxe of efficiency 5 and unbreaking 5 and fortune 5 named "&6Kifol Zwycienscy"
  16.     item14: apple of sharpness 5 named "Jabółko"
  17.     item15: 7 golden sword
  18.  
  19. on script load:
  20.     clear {chest::*}
  21.     add {@item1} to {chest::*}
  22.     add {@item2} to {chest::*}
  23.     add {@item3} to {chest::*}
  24.     add {@item4} to {chest::*}
  25.     add {@item5} to {chest::*}
  26.     add {@item6} to {chest::*}
  27.     add {@item7} to {chest::*}
  28.     add {@item8} to {chest::*}
  29.     add {@item9} to {chest::*}
  30.     add {@item10} to {chest::*}
  31.     add {@item11} to {chest::*}
  32.     add {@item12} to {chest::*}
  33.     add {@item13} to {chest::*}
  34.     add {@item14} to {chest::*}
  35.     add {@item15} to {chest::*}
  36.     stop
  37.    
  38.        
  39. on rightclick on a chest:
  40.     if {chest.%location of event-block%} is true:
  41.         spawn 150 of particle enchantment table:1 at the targeted block to the player
  42.         set {chest.%location of event-block%} to false
  43.         set {_x} to event-block
  44.         set {_item} to a random item out of {chest::*}
  45.         add {_item} to {_x}
  46.         send "%{_item}%"
  47.         wait 5 second
  48.         remove {_item} from {_x}
  49.         spawn 50 of particle witch Magic:1 offset by 0.5, 1, 0.5 at the targeted block to the player
  50.         set clicked block to air
  51.         stop
  52.        
  53. on mine:
  54.     if {chest.%location of event-block%} is true:
  55.         cancel event
  56.     else:
  57.         if chance of {@procent}%:
  58.             set {chest.%location of event-block%} to true
  59.             spawn 80 of particle happy villager:1 offset by 0.5, 1, 0.5 at the targeted block to the player
  60.             set event-block to chest
Advertisement
Add Comment
Please, Sign In to add comment