Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on right click on chest:
- if event-block is south facing chest:
- set {_facing} to south
- cancel event
- set {_d} to location of event-block
- set {_d} to rounded {_d}
- create new gui with id "crate" with virtual chest named " &8>=&b&lCRATES&8=<" with 5 rows
- open gui with id "crate" to player
- loop all integers between 0 and 21:
- format gui slot loop-value-2 of player with gray glass panes named ""
- loop all integers between 22 and 23:
- format gui slot loop-value-2 of player with gray glass panes named ""
- loop all integers between 25 and 25:
- format gui slot loop-value-2 of player with gray glass panes named ""
- loop all integers between 27 and 58:
- format gui slot loop-value-2 of player with gray glass panes named ""
- set {_t} to x coordinate of event-block
- set {_d} to y coordinate of event-block
- set {_g} to z coordinate of event-block
- set {_nochange} to location of event-block
- set {_nochange} to rounded {_nochange}
- set {_p} to player
- format gui slot 20 of player with chest named "&aRookie Crate &8(%{crates::rookie::%player's uuid%}%)" to close:
- if {crates::rookie::%player's uuid%} is more than 0:
- add 1 to {_d}
- loop {d::rookie::*}:
- add loop-value to {_s}
- if {_facing} is south:
- add 1.5 to {_t}
- set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o} to last spawned entity
- whileAlive({_o})
- subtract 3 from {_t}
- add 0.5 to {_g}
- set {_h} to location({_t}, {_d}, {_g}, world "world")
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o2} to last spawned entity
- whileAlive({_o2})
- loop 7 times:
- push {_o} down with force 0.16
- push {_o} west with force 0.0068
- push {_o2} down with force 0.16
- push {_o2} east with force 0.0068
- wait 1 tick
- play chest open animation at block at {_nochange} for all players
- wait 1.5 seconds
- set {_m} to the x coord of {_nochange}
- set {_b} to the y coord of {_nochange} - 1
- set {_n} to the z coord of {_nochange}
- add .3 to {_b}
- # WIN ITEMS
- set {_h} to a random integer between 1 and 10000
- # 100 is 1%, 1000 is 10%, 10000 is 100%
- if {_h} is between 1 and 1000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond sword
- set {_o3} to last spawned entity
- whileAlive({_o3})
- else if {_h} is between 1001 and 5000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond ore
- set {_o3} to last spawned entity
- whileAlive({_o3})
- else if {_h} is between 5001 and 10000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond block
- set {_o3} to last spawned entity
- whileAlive({_o3})
- # END OF WIN ITEMS
- kill {_o}
- kill {_o2}
- wait 3.5 seconds
- play chest close animation at block at {_nochange} for all players
- kill {_o3}
- else:
- send "You do not have a key for this crate"
- format gui slot 22 of player with chest named "&aAncient Crate &8(%{crates::ancient::%player's uuid%}%)" to close:
- if {crates::ancient::%player's uuid%} is more than 0:
- add 1 to {_d}
- loop {d::rookie::*}:
- add loop-value to {_s}
- if {_facing} is south:
- add 1.5 to {_t}
- set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o} to last spawned entity
- whileAlive({_o})
- subtract 3 from {_t}
- add 0.5 to {_g}
- set {_h} to location({_t}, {_d}, {_g}, world "world")
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o2} to last spawned entity
- whileAlive({_o2})
- loop 7 times:
- push {_o} down with force 0.16
- push {_o} west with force 0.0068
- push {_o2} down with force 0.16
- push {_o2} east with force 0.0068
- wait 1 tick
- play chest open animation at block at {_nochange} for all players
- wait 1.5 seconds
- set {_m} to the x coord of {_nochange}
- set {_b} to the y coord of {_nochange} - 1
- set {_n} to the z coord of {_nochange}
- add .3 to {_b}
- # WIN ITEMS
- set {_h} to a random integer between 1 and 10000
- # 100 is 1%, 1000 is 10%, 10000 is 100%
- if {_h} is between 1 and 1000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond sword
- set {_o3} to last spawned entity
- whileAlive({_o3})
- else if {_h} is between 1001 and 5000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond ore
- set {_o3} to last spawned entity
- whileAlive({_o3})
- else if {_h} is between 5001 and 10000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond block
- set {_o3} to last spawned entity
- whileAlive({_o3})
- # END OF WIN ITEMS
- kill {_o}
- kill {_o2}
- wait 3.5 seconds
- play chest close animation at block at {_nochange} for all players
- kill {_o3}
- else:
- send "You do not have a key for this crate"
- format gui slot 24 of player with chest named "&aMythical Crate &8(%{crates::mythical::%player's uuid%}%)" to close:
- if {crates::mythical::%player's uuid%} is more than 0:
- add 1 to {_d}
- loop {d::rookie::*}:
- add loop-value to {_s}
- if {_facing} is south:
- add 1.5 to {_t}
- set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o} to last spawned entity
- whileAlive({_o})
- subtract 3 from {_t}
- add 0.5 to {_g}
- set {_h} to location({_t}, {_d}, {_g}, world "world")
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o2} to last spawned entity
- whileAlive({_o2})
- loop 7 times:
- push {_o} down with force 0.16
- push {_o} west with force 0.0068
- push {_o2} down with force 0.16
- push {_o2} east with force 0.0068
- wait 1 tick
- play chest open animation at block at {_nochange} for all players
- wait 1.5 seconds
- set {_m} to the x coord of {_nochange}
- set {_b} to the y coord of {_nochange} - 1
- set {_n} to the z coord of {_nochange}
- add .3 to {_b}
- # WIN ITEMS
- set {_h} to a random integer between 1 and 10000
- # 100 is 1%, 1000 is 10%, 10000 is 100%
- if {_h} is between 1 and 1000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond sword
- set {_o3} to last spawned entity
- whileAlive({_o3})
- else if {_h} is between 1001 and 5000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond ore
- set {_o3} to last spawned entity
- whileAlive({_o3})
- else if {_h} is between 5001 and 10000:
- summon a armor stand at location({_m}, {_b}, {_n}, world "world")
- add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
- set helmet of last spawned entity to diamond block
- set {_o3} to last spawned entity
- whileAlive({_o3})
- # END OF WIN ITEMS
- kill {_o}
- kill {_o2}
- wait 3.5 seconds
- play chest close animation at block at {_nochange} for all players
- kill {_o3}
- else:
- send "You do not have a key for this crate"
- on left click on chest:
- cancel event
- play chest open animation at event-block for player
- wait 10 seconds
- play chest close animation at event-block for player
- command /setcrates <player> <text> <integer>:
- permission: set.crates
- trigger:
- set {crates::%arg 2%::%arg-1's uuid%} to arg 3
- on join:
- if {crates::rookie::%player's uuid%} is not set:
- set {crates::rookie::%player's uuid%} to 0
- if {crates::ancient::%player's uuid%} is not set:
- set {crates::ancient::%player's uuid%} to 0
- if {crates::mythical::%player's uuid%} is not set:
- set {crates::mythical::%player's uuid%} to 0
- function whileAlive(E: entity):
- while {_E} is alive:
- set {_V} to velocity of {_E}
- set velocity of {_E} to vector(x of {_V}, 0, z of {_V})
- wait 1 tick
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement