Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. on rightclick on jukebox:
  2. cancel event
  3. open chest with 6 rows named "&6Crates System" to player
  4. wait a tick
  5. add stone to {_roll::*}
  6. add diamond to {_roll::*}
  7. add diamond sword to {_roll::*}
  8. add dirt to {_roll::*}
  9. add gold block to {_roll::*}
  10. add redstone block to {_roll::*}
  11. add beacon to {_roll::*}
  12. add name tag to {_roll::*}
  13. set {_speedFinal} to 2
  14. set {_Selector1} to 45
  15. set {_Selector1.2} to 47
  16. set {_Selector2} to 48
  17. set {_Selector2.2} to 50
  18. set {_Selector3} to 51
  19. set {_Selector3.2} to 53
  20. loop (random integer between 10 and 40) times:
  21. set {_sel} to 9
  22. loop 8 times:
  23. set {_sel1} to {_sel} - 1
  24. set {_item1::%{_sel}%} to {_item1::%{_sel1}%}
  25. set {_item2::%{_sel}%} to {_item2::%{_sel1}%}
  26. set {_item3::%{_sel}%} to {_item3::%{_sel1}%}
  27. subtract 1 from {_sel}
  28. set {_item1::1} to a random element out of {_roll::*}
  29. set {_item2::1} to a random element out of {_roll::*}
  30. set {_item3::1} to a random element out of {_roll::*}
  31. loop integers between 0 and 53:
  32. if loop-number-2 is {_Selector1}, {_Selector1.2}, {_Selector2}, {_Selector2.2}, {_Selector3} or {_Selector3.2}:
  33. set slot loop-number-2 of player's current inventory to shiny light green stained glass pane named " "
  34. else:
  35. set slot loop-number-2 of player's current inventory to black stained glass pane named " "
  36. #!The num and math below defines the slots for the items
  37. set {_num} to 0
  38. loop 6 times:
  39. set {_Math} to 9 * {_num}
  40. set slot {_Math} + 1 of player's current inventory to {_item1::%loop-number-3%}
  41. set slot {_Math} + 4 of player's current inventory to {_item2::%loop-number-3%}
  42. set slot {_Math} + 7 of player's current inventory to {_item3::%loop-number-3%}
  43. add 1 to {_num}
  44. #!This is the control for the dirrection the items move
  45. loop 3 times:
  46. subtract 9 from {_Selector%loop-number-2%}
  47. subtract 9 from {_Selector%loop-number-2%.2}
  48. #!{_t} is a test needed due to slot 0 being reset on roll if it lands on the first row
  49. clear {_t}
  50. #!This below is a catch, so that the crate doesn't loop off the page. This brings the loop back around
  51. if {_Selector1} < 0:
  52. set {_Selector1} to 45
  53. set {_Selector1.2} to 47
  54. set {_t} to true
  55. if {_Selector2} <= 0:
  56. set {_Selector2} to 48
  57. set {_Selector2.2} to 50
  58. if {_Selector3} <= 0:
  59. set {_Selector3} to 51
  60. set {_Selector3.2} to 53
  61. #!This below is just sound. It plays it at the location of the player, so you can change it to client side sounds, etc.
  62. add 1 to {_sound}
  63. if {_sound} > 3:
  64. set {_sound} to 1
  65. if {_sound} = 1:
  66. play note pling at player with pitch 2
  67. if {_sound} = 2:
  68. play note pling at player with pitch 1
  69. if {_sound} = 3:
  70. play note pling at player with pitch 0.5
  71. #!This below causes the crate to slow down when it gets closer to the end of the animation. The more the percent, the longer the tick delay will be.
  72. add 1 to {_speed}
  73. #!This below is the ticks per lowering. Meaning it will lower the speed per every X number of loops
  74. if {_speed} is 5:
  75. set {_speed} to 0
  76. add 1 to {_speedFinal}
  77. loop {_speedFinal} times:
  78. wait a tick
  79. #!This is a reset system, to make sure that the crate items output matches what has been won. Reason behind using this, is due to the crate being ahead of itself.
  80. loop 3 times:
  81. add 9 to {_Selector%loop-number%}
  82. add 9 to {_Selector%loop-number%.2}
  83. #!This is a reset feature for the first row. If the green selector is set to 0 by chance, it won't output a item without this test.
  84. if {_t} is set:
  85. set {_Selector1} to 0
  86. set {_Selector1.2} to 2
  87. set {_Selector2} to 3
  88. set {_Selector2.2} to 5
  89. set {_Selector3} to 6
  90. set {_Selector3.2} to 8
  91. #!This is where you can give players or test for which item has won. This is the main area where you can add what ever you want.
  92. message "Your first item won is %slot {_Selector1} + 1 of player's current inventory%"
  93. message "Your second item won is %slot {_Selector2} + 1 of player's current inventory%"
  94. message "Your third item won is %slot {_Selector3} + 1 of player's current inventory%"
  95. give player slot {_Selector1} + 1 of player's current inventory
  96. give player slot {_Selector2} + 1 of player's current inventory
  97. give player slot {_Selector3} + 1 of player's current inventory
  98. on inventory click:
  99. if inventory name of player's current inventory is "&6Crates System":
  100. cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement