Oxalist

Player Vaults Skript

Mar 11th, 2020 (edited)
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.71 KB | None | 0 0
  1. function addVaultIcon(p: player, icon: text):
  2. add {_icon} to {vaulticons::*}
  3.  
  4. function removeVaultIcon(p: player, icon: text):
  5. remove {_icon} from {vaulticons::*}
  6.  
  7. command /addvaultitem [<text>]:
  8. trigger:
  9. addVaultIcon(player, arg 1)
  10.  
  11. command /removevaultitem [<text>]:
  12. trigger:
  13. removeVaultIcon(player, arg 1)
  14.  
  15. function openVault(p: player, number: number):
  16. open virtual chest inventory with size 6 named "Vault Inventory ##%{_number}%" to {_p}
  17. format a gui slot 45 of {_p} with black stained glass pane named "&7" to do nothing
  18. format a gui slot 46 of {_p} with black stained glass pane named "&7" to do nothing
  19. format a gui slot 47 of {_p} with black stained glass pane named "&7" to do nothing
  20. format a gui slot 48 of {_p} with black stained glass pane named "&7" to do nothing
  21. format a gui slot 49 of {_p} with gray dye named "&cGo back" to run function vaultList({_p})
  22. format a gui slot 50 of {_p} with black stained glass pane named "&7" to do nothing
  23. format a gui slot 51 of {_p} with black stained glass pane named "&7" to do nothing
  24. format a gui slot 52 of {_p} with black stained glass pane named "&7" to do nothing
  25. format a gui slot 53 of {_p} with black stained glass pane named "&7" to do nothing
  26. wait 1 tick
  27. set {_num} to 0
  28. loop {vaults::%{_number}%::%{_p}%::*}:
  29. set slot {_num} of {_p}'s current inventory to loop-value
  30. add 1 to {_num}
  31.  
  32. function renameVault(p: player, number: number):
  33. set {vaulrenaming::%{_p}%} to {_number}
  34. if {renamechat::%{_p}%} is not set:
  35. close {_p}'s inventory
  36. set {renamechat::%{_p}%} to true
  37. play skellett sound "ENTITY_EXPERIENCE_ORB_PICKUP" for {_p} with volume 1 with pitch 1
  38. message centered "" and "&6&lVault Renaming" and "" and " &fYou are currently in the process of renaming your vault" and " &fto enter a name &etype &fin chat, or type &ccancel &fto cancel" and "" to {_p}
  39.  
  40. function changeVaultIcon(p: player, number: number):
  41. open virtual chest inventory with size 6 named "Vault Icon ##%{_number}%" to {_p}
  42. format a gui slot 0 of {_p} with black stained glass pane named "&7" to do nothing
  43. format a gui slot 1 of {_p} with black stained glass pane named "&7" to do nothing
  44. format a gui slot 2 of {_p} with black stained glass pane named "&7" to do nothing
  45. format a gui slot 3 of {_p} with black stained glass pane named "&7" to do nothing
  46. if {vaulticon::%{_p}%::%{_number}%} is not set:
  47. format a gui slot 4 of {_p} with chest named "&fChest" to do nothing
  48. else if {vaulticon::%{_p}%::%{_number}%} is set:
  49. format a gui slot 4 of {_p} with {vaulticon::%{_p}%::%{_number}%} named "&f%{vaulticon::%{_p}%::%{_number}%}%" to do nothing
  50. format a gui slot 5 of {_p} with black stained glass pane named "&7" to do nothing
  51. format a gui slot 6 of {_p} with black stained glass pane named "&7" to do nothing
  52. format a gui slot 7 of {_p} with black stained glass pane named "&7" to do nothing
  53. format a gui slot 8 of {_p} with black stained glass pane named "&7" to do nothing
  54. format a gui slot 45 of {_p} with black stained glass pane named "&7" to do nothing
  55. format a gui slot 46 of {_p} with black stained glass pane named "&7" to do nothing
  56. format a gui slot 47 of {_p} with black stained glass pane named "&7" to do nothing
  57. format a gui slot 48 of {_p} with black stained glass pane named "&7" to do nothing
  58. format a gui slot 49 of {_p} with gray dye named "&cGo back" to run function vaultList({_p})
  59. format a gui slot 50 of {_p} with black stained glass pane named "&7" to do nothing
  60. format a gui slot 51 of {_p} with black stained glass pane named "&7" to do nothing
  61. format a gui slot 52 of {_p} with black stained glass pane named "&7" to do nothing
  62. format a gui slot 53 of {_p} with black stained glass pane named "&7" to do nothing
  63. set {_i} to 9
  64. loop {vaulticons::*}:
  65. set {_itemtype} to "%loop-value%" parsed as item
  66. format a gui slot {_i} of {_p} with {_itemtype} named "&e%loop-value%" to run:
  67. set {vaulticon::%{_p}%::%{_number}%} to {_itemtype}
  68. set slot 4 of player's current inventory to {_itemtype}
  69. add 1 to {_i}
  70.  
  71. function vaultList(p: player):
  72. open virtual chest inventory with size 3 named "Select a vault" to {_p}
  73. set {_i} to 10
  74. set {_number} to 1
  75. loop 7 times:
  76. if {vaultname::%{_p}%::%{_number}%} is not set:
  77. set {vaultname::%{_p}%::%{_number}%} to "&6&lVault"
  78. if {vaulticon::%{_p}%::%{_number}%} is not set:
  79. format a gui slot {_i} of {_p} with chest named "%{vaultname::%{_p}%::%{_number}%}% &6##%{_number}%" with lore "" and "&fContains &a&l%amount of {vaults::%{_number}%::%{_p}%::*}% &fslot(s)" and "" and "&fLeft-Click to &e&lOPEN" and "&fRight-Click to &e&lCHANGE ICON" and "&fMiddle-Click to &e&lCHANGE NAME" to run function openVault({_p}, {_number}) with "left" click
  80. else if {vaulticon::%{_p}%::%{_number}%} is set:
  81. format a gui slot {_i} of {_p} with {vaulticon::%{_p}%::%{_number}%} named "%{vaultname::%{_p}%::%{_number}%}% &6##%{_number}%" with lore "" and "&fContains &a&l%amount of {vaults::%{_number}%::%{_p}%::*}% &fslot(s)" and "" and "&fLeft-Click to &e&lOPEN" and "&fRight-Click to &e&lCHANGE ICON" and "&fMiddle-Click to &e&lCHANGE NAME" to run function openVault({_p}, {_number}) with "left" click
  82. if {vaulticon::%{_p}%::%{_number}%} is not set:
  83. format a gui slot {_i} of {_p} with chest named "%{vaultname::%{_p}%::%{_number}%}% &6##%{_number}%" with lore "" and "&fContains &a&l%amount of {vaults::%{_number}%::%{_p}%::*}% &fslot(s)" and "" and "&fLeft-Click to &e&lOPEN" and "&fRight-Click to &e&lCHANGE ICON" and "&fMiddle-Click to &e&lCHANGE NAME" to run function changeVaultIcon({_p}, {_number}) with "right" click
  84. else if {vaulticon::%{_p}%::%{_number}%} is set:
  85. format a gui slot {_i} of {_p} with {vaulticon::%{_p}%::%{_number}%} named "%{vaultname::%{_p}%::%{_number}%}% &6##%{_number}%" with lore "" and "&fContains &a&l%amount of {vaults::%{_number}%::%{_p}%::*}% &fslot(s)" and "" and "&fLeft-Click to &e&lOPEN" and "&fRight-Click to &e&lCHANGE ICON" and "&fMiddle-Click to &e&lCHANGE NAME" to run function changeVaultIcon({_p}, {_number}) with "right" click
  86. if {vaulticon::%{_p}%::%{_number}%} is not set:
  87. format a gui slot {_i} of {_p} with chest named "%{vaultname::%{_p}%::%{_number}%}% &6##%{_number}%" with lore "" and "&fContains &a&l%amount of {vaults::%{_number}%::%{_p}%::*}% &fslot(s)" and "" and "&fLeft-Click to &e&lOPEN" and "&fRight-Click to &e&lCHANGE ICON" and "&fMiddle-Click to &e&lCHANGE NAME" to run function renameVault({_p}, {_number}) with "middle" click
  88. else if {vaulticon::%{_p}%::%{_number}%} is set:
  89. format a gui slot {_i} of {_p} with {vaulticon::%{_p}%::%{_number}%} named "%{vaultname::%{_p}%::%{_number}%}% &6##%{_number}%" with lore "" and "&fContains &a&l%amount of {vaults::%{_number}%::%{_p}%::*}% &fslot(s)" and "" and "&fLeft-Click to &e&lOPEN" and "&fRight-Click to &e&lCHANGE ICON" and "&fMiddle-Click to &e&lCHANGE NAME" to run function renameVault({_p}, {_number}) with "middle" click
  90. add 1 to {_number}
  91. add 1 to {_i}
  92.  
  93. on inventory close:
  94. if inventory name of player's current inventory contains "Vault ##1":
  95. loop 44 times:
  96. set {vaults::1::%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
  97. wait 2 ticks
  98. else if inventory name of player's current inventory contains "Vault ##2":
  99. loop 44 times:
  100. set {vaults::2::%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
  101. wait 2 ticks
  102. else if inventory name of player's current inventory contains "Vault ##3":
  103. loop 44 times:
  104. set {vaults::3::%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
  105. wait 2 ticks
  106. else if inventory name of player's current inventory contains "Vault ##4":
  107. loop 44 times:
  108. set {vaults::4::%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
  109. wait 2 ticks
  110. else if inventory name of player's current inventory contains "Vault ##5":
  111. loop 44 times:
  112. set {vaults::5::%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
  113. wait 2 ticks
  114. else if inventory name of player's current inventory contains "Vault ##6":
  115. loop 44 times:
  116. set {vaults::6::%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
  117. wait 2 ticks
  118. else if inventory name of player's current inventory contains "Vault ##7":
  119. loop 44 times:
  120. set {vaults::7::%player%::%loop-number - 1%} to slot "%loop-number - 1%" parsed as an integer of current inventory of player
  121. wait 2 ticks
  122.  
  123. command /vault [<number>]:
  124. trigger:
  125. if arg 1 is not set:
  126. vaultList(player)
  127.  
  128. command /addblacklist [<text>]:
  129. permission: add.words
  130. trigger:
  131. if arg 1 is set:
  132. if {blacklistwords::*} does not contain arg 1:
  133. add arg 1 to {blacklistwords::*}
  134. send "&fAdded word %arg 1%" to player
  135. else:
  136. send "&cWord already added" to player
  137. else if arg 1 is not set:
  138. send "&c/addblacklist <word>" to player
  139.  
  140. command /listblacklist:
  141. permission: add.words
  142. trigger:
  143. send "%{blacklistwords::*}%" to player
Add Comment
Please, Sign In to add comment