Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on rightclick on jukebox:
- cancel event
- open chest with 6 rows named "&6Crates System" to player
- wait a tick
- add stone to {_roll::*}
- add diamond to {_roll::*}
- add diamond sword to {_roll::*}
- add dirt to {_roll::*}
- add gold block to {_roll::*}
- add redstone block to {_roll::*}
- add beacon to {_roll::*}
- add name tag to {_roll::*}
- set {_speedFinal} to 2
- set {_Selector1} to 45
- set {_Selector1.2} to 47
- set {_Selector2} to 48
- set {_Selector2.2} to 50
- set {_Selector3} to 51
- set {_Selector3.2} to 53
- loop (random integer between 10 and 40) times:
- set {_sel} to 9
- loop 8 times:
- set {_sel1} to {_sel} - 1
- set {_item1::%{_sel}%} to {_item1::%{_sel1}%}
- set {_item2::%{_sel}%} to {_item2::%{_sel1}%}
- set {_item3::%{_sel}%} to {_item3::%{_sel1}%}
- subtract 1 from {_sel}
- set {_item1::1} to a random element out of {_roll::*}
- set {_item2::1} to a random element out of {_roll::*}
- set {_item3::1} to a random element out of {_roll::*}
- loop integers between 0 and 53:
- if loop-number-2 is {_Selector1}, {_Selector1.2}, {_Selector2}, {_Selector2.2}, {_Selector3} or {_Selector3.2}:
- set slot loop-number-2 of player's current inventory to shiny light green stained glass pane named " "
- else:
- set slot loop-number-2 of player's current inventory to black stained glass pane named " "
- #!The num and math below defines the slots for the items
- set {_num} to 0
- loop 6 times:
- set {_Math} to 9 * {_num}
- set slot {_Math} + 1 of player's current inventory to {_item1::%loop-number-3%}
- set slot {_Math} + 4 of player's current inventory to {_item2::%loop-number-3%}
- set slot {_Math} + 7 of player's current inventory to {_item3::%loop-number-3%}
- add 1 to {_num}
- #!This is the control for the dirrection the items move
- loop 3 times:
- subtract 9 from {_Selector%loop-number-2%}
- subtract 9 from {_Selector%loop-number-2%.2}
- #!{_t} is a test needed due to slot 0 being reset on roll if it lands on the first row
- clear {_t}
- #!This below is a catch, so that the crate doesn't loop off the page. This brings the loop back around
- if {_Selector1} < 0:
- set {_Selector1} to 45
- set {_Selector1.2} to 47
- set {_t} to true
- if {_Selector2} <= 0:
- set {_Selector2} to 48
- set {_Selector2.2} to 50
- if {_Selector3} <= 0:
- set {_Selector3} to 51
- set {_Selector3.2} to 53
- #!This below is just sound. It plays it at the location of the player, so you can change it to client side sounds, etc.
- add 1 to {_sound}
- if {_sound} > 3:
- set {_sound} to 1
- if {_sound} = 1:
- play note pling at player with pitch 2
- if {_sound} = 2:
- play note pling at player with pitch 1
- if {_sound} = 3:
- play note pling at player with pitch 0.5
- #!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.
- add 1 to {_speed}
- #!This below is the ticks per lowering. Meaning it will lower the speed per every X number of loops
- if {_speed} is 5:
- set {_speed} to 0
- add 1 to {_speedFinal}
- loop {_speedFinal} times:
- wait a tick
- #!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.
- loop 3 times:
- add 9 to {_Selector%loop-number%}
- add 9 to {_Selector%loop-number%.2}
- #!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.
- if {_t} is set:
- set {_Selector1} to 0
- set {_Selector1.2} to 2
- set {_Selector2} to 3
- set {_Selector2.2} to 5
- set {_Selector3} to 6
- set {_Selector3.2} to 8
- #!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.
- message "Your first item won is %slot {_Selector1} + 1 of player's current inventory%"
- message "Your second item won is %slot {_Selector2} + 1 of player's current inventory%"
- message "Your third item won is %slot {_Selector3} + 1 of player's current inventory%"
- give player slot {_Selector1} + 1 of player's current inventory
- give player slot {_Selector2} + 1 of player's current inventory
- give player slot {_Selector3} + 1 of player's current inventory
- on inventory click:
- if inventory name of player's current inventory is "&6Crates System":
- cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement