Facebook
From Ample Monkey, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 196
  1. on right click:
  2.     if target block is an ender chest:
  3.         cancel event
  4.         open virtual chest inventory with size 6 named "&7Vaults (Page 1)" for player
  5.         set {_n} to 0
  6.         loop 25 times:
  7.             if {_n} is 10 or 19 or 28 or 37:
  8.                 add 7 to {_n}
  9.             format gui slot {_n} of player with black stained glass pane named "&f"
  10.             add 1 to {_n}
  11.         format gui slot 53 of player with paper named "&c&lNext »" to run function page2(player)
  12.         set {_n} to 10
  13.         set {_n2} to 1
  14.         loop 28 times:
  15.             if {_n} is 17 or 26 or 35:
  16.                 add 2 to {_n}
  17.             format gui slot {_n} of player with ender chest named "&7Vault %{_n2}%" to run player command "/vault %{_n2}%"
  18.             add 1 to {_n}
  19.             add 1 to {_n2}
  20.  
  21. function page2(p: player):
  22.     open virtual chest inventory with size 6 named "&7Vaults (Page 2)" for {_p}
  23.     set {_n} to 0
  24.     loop 25 times:
  25.         if {_n} is 10 or 19 or 28 or 37:
  26.             add 7 to {_n}
  27.         format gui slot {_n} of {_p} with black stained glass pane named "&f"
  28.         add 1 to {_n}
  29.     set {_n} to 10
  30.     set {_n2} to 29
  31.     loop 28 times:
  32.         if {_n} is 17 or 26 or 35:
  33.             add 2 to {_n}
  34.         format gui slot {_n} of {_p} with ender chest named "&7Vault %{_n2}%" to run {_p} command "/vault %{_n2}%"
  35.         add 1 to {_n}
  36.         add 1 to {_n2}
  37.     format gui slot 53 of {_p} with paper named "&c&l« Back" to run function back({_p})
  38.  
  39. command /vault [<integer>]:
  40.     trigger:
  41.         if argument 1 is not set:
  42.             send "&cIncorrect Usage."
  43.         else:
  44.             if player has the permission "vault.%arg-1%":
  45.                 open chest with 6 rows named "&7%player% &8- &7%arg-1%" to player
  46.                 set {_n} to 0
  47.                 loop 36 times:
  48.                     add {bp::%player's UUID%::%{_n}%::%arg-1%} to the current inventory of player
  49.                     add 1 to {_n}
  50.                 format gui slot 45 of player with paper named "&c&l« Back" to run function back(player)
  51.                 set {_n} to 45
  52.                 loop 8 times:
  53.                     add 1 to {_n}
  54.                     format gui slot {_n} of player with barrier named "&f"
  55.                 set {_n} to 36
  56.                 loop 9 times:
  57.                     format gui slot {_n} of player with black stained glass pane named "&f"
  58.                     add 1 to {_n}
  59.             else:
  60.                 send "&cInsufficient Permissions."
  61.  
  62. function back(p: player):
  63.     open virtual chest inventory with size 6 named "&7Vaults (Page 1)" for {_p}
  64.     set {_n} to 0
  65.     loop 25 times:
  66.         if {_n} is 10 or 19 or 28 or 37:
  67.             add 7 to {_n}
  68.         format gui slot {_n} of {_p} with black stained glass pane named "&f"
  69.         add 1 to {_n}
  70.     format gui slot 53 of {_p} with paper named "&c&lNext »" to run function page2({_p})
  71.     set {_n} to 10
  72.     set {_n2} to 1
  73.     loop 28 times:
  74.         if {_n} is 17 or 26 or 35:
  75.             add 2 to {_n}
  76.         format gui slot {_n} of {_p} with ender chest named "&7Vault %{_n2}%" to run {_p} command "/vault %{_n2}%"
  77.         add 1 to {_n}
  78.         add 1 to {_n2}
  79.  
  80. on inventory close:
  81.     if name of player's current inventory does not contain "%player%":
  82.         stop
  83.     else:
  84.         loop 56 times:
  85.             if name of player's current inventory is "%player% &8- %loop-value%":
  86.                 set {v.%player%} to loop-value
  87.         loop 36 times:
  88.             set {bp::%player's U