akon1248

Storage

Mar 29th, 2019
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. on join:
  2. loop 9 times:
  3. add 1 to {_loopnum}
  4. set {_slot} to 0
  5. loop 54 times:
  6. if {storage.%UUID of player%.%{_loopnum}%::%{_slot}%} is not set:
  7. set {storage.%UUID of player%.%{_loopnum}%::%{_slot}%} to air
  8. add 1 to {_slot}
  9. command /storage:
  10. trigger:
  11. open chest with 1 row named "&aStorage Menu" to player
  12. wait 1 tick
  13. loop 9 times:
  14. set {_slot} to loop-number - 1
  15. set slot {_slot} of player's current inventory to chest named "&6Storage &eNo.%loop-number%"
  16. on inventory click:
  17. inventory name of clicked inventory is "&aStorage Menu"
  18. inventory type of clicked inventory is "CHEST"
  19. "%clicked inventory%" is "inventory of <none>"
  20. clicked item is chest
  21. name of clicked item contain "&6Storage &eNo."
  22. play sound "BLOCK_CHEST_OPEN" to player with volume 1 and pitch 5
  23. set {_storagenumber} to name of clicked item
  24. replace "&6Storage &eNo." in {_storagenumber} with ""
  25. cancel event
  26. execute console command "menu create storage-%UUID of player%-%{_storagenumber}% 6 &6Storage &eNo.%{_storagenumber}%"
  27. execute console command "menu edit %player% storage-%UUID of player%-%{_storagenumber}%"
  28. on inventory close:
  29. inventory name of player's current inventory contain "&6Storage &eNo."
  30. inventory type of player's current inventory is "CHEST"
  31. play sound "BLOCK_CHEST_CLOSE" to player with volume 1 and pitch 5
Advertisement
Add Comment
Please, Sign In to add comment