SHARE
TWEET

Untitled

a guest Oct 13th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Make sure to the following below.
  2. #
  3. # Go to, Skript > config.sk > enable effective commands > Go in game > /sk reload config > Type in chat, "!set {CrateLoc} to location of player" above the crate block, make sure it is centered!.
  4. #
  5.  
  6. options:
  7.     name: "&8Crate"
  8.  
  9. function Crate(p: player):
  10.     open chest with 3 rows named {@name} to {_p}
  11.     set {Crate} to true
  12.     add dirt named "&7&oThe dirt block.." to {_roll::*}
  13.     set {_speedFinal} to 2
  14.     set {_Selector1} to 4
  15.     set {_Selector2} to 22
  16.     loop (random integer between 21 and 50) times:
  17.         if {Crate} isn't set:
  18.            stop
  19.        set {_sel} to 21
  20.        loop {_sel} times:
  21.            set {_sel2} to {_sel} - 1
  22.            set {_item::%{_sel}%} to {_item::%{_sel2}%}
  23.            subtract 1 from {_sel}
  24.        #Grab a new item from the options
  25.        set {_item::1} to a random element out of {_roll::*}
  26.        loop integers between 0 and inventory size of {_p}'s current inventory - 1:
  27.             set {_loop} to loop-number-2
  28.             if {_loop} is {_Selector1} or {_Selector2}:
  29.                 set slot loop-number-2 of {_p}'s current inventory to orange stained glass pane named " "
  30.            else:
  31.                set slot loop-number-2 of {_p}'s current inventory to black stained glass pane named " "
  32.             loop 9 times:
  33.                 set slot 8 + loop-number-3 of {_p}'s current inventory to {_item::%loop-number-3%}
  34.  
  35.        add 1 to {_sound}
  36.        if {_sound} > 3:
  37.            set {_sound} to 1
  38.        if {_sound} = 1:
  39.            play sound "ui.button.click" with volume 1 and pitch 4 at {_p}
  40.        else if {_sound} = 2:
  41.            play sound "ui.button.click" with volume 1 and pitch 4 at {_p}
  42.        else if {_sound} = 3:
  43.            play sound "ui.button.click" with volume 1 and pitch 2 at {_p}
  44.        add 1 to {_speed}
  45.        if {_speed} is 5:
  46.            set {_speed} to 0
  47.            add 1 to {_speedFinal}
  48.        loop {_speedFinal} times:
  49.            wait a tick
  50.    set {_wonItem} to slot 13 of {_p}'s current inventory
  51.     delete {Crate}
  52.     close inventory of {_p}
  53.     # adding if {_wonItem} is dirt would detect the won item and display your custom needs.
  54.     if {_wonItem} is dirt:
  55.         message "&aYou won the darn freaking &c&lOG &adirt block!!" to {_p}
  56.         create holo object "&6&lCRATE NAME;;ItemStack:Dirt;" with id "Prize" at location of {CrateLoc}
  57.         give {_p} {_wonItem}
  58.         wait 3 seconds
  59.         delete holo object "Prize"
  60.  
  61. on inventory click:
  62.     if inventory name of player's current inventory is {@name}:
  63.        cancel event
  64. on inventory close:
  65.    if {Crate} is true:
  66.        delete {Crate}
  67.        wait 3 ticks
  68.        Crate(player)
  69.  
  70. on rightclick on end portal frame:
  71.    if player is holding a prismarine shard named "Crate Key":
  72.        if {Crate} isn't true:
  73.             Crate(player)
  74.             remove 1 prismarine shard named "Crate Key" from player
  75.         else:
  76.             send "&cThis crate is currently being used."
  77.     else:
  78.         send "&cYou do not have the correct crate key for this!"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top