Zeldaboy111

Quarry GUI ]|[ Skript #319

Jun 12th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. #GUI when clicking on it
  2. function checkQuarry(p: Player, loc: Location) :: boolean:
  3. set {_below} to block 1 meters below {_loc}
  4. if block at {_below} is not dropper:
  5. return false
  6. set {_detected} to false
  7. if block at location 1 meters north of {_below} is hopper:
  8. if block at location 1 meters south of {_below} is chest:
  9. if block at location 2 meters south of {_below} is chest:
  10. set {_detected} to true
  11. else if block at location 1 meters east of {_below} is hopper:
  12. if block at location 1 meters west of {_below} is chest:
  13. if block at location 2 meters west of {_below} is chest:
  14. set {_detected} to true
  15. else if block at location 1 meters south of {_below} is hopper:
  16. if block at location 1 meters north of {_below} is chest:
  17. if block at location 2 meters north of {_below} is chest:
  18. set {_detected} to true
  19. else if block at location 1 meters west of {_below} is hopper:
  20. if block at location 1 meters east of {_below} is chest:
  21. if block at location 2 meters east of {_below} is chest:
  22. set {_detected} to true
  23.  
  24. return {_detected}
  25.  
  26. function quarryGUI(p: Player, loc: Location):
  27. set {quarry.open.%{_p}%} to {_loc}
  28. open chest with 5 rows named "Quarry" to {_p}
  29. wait 2 ticks
  30. set {_count} to 45
  31. loop 9 times:
  32. set slot loop-value - 1 of {_p}'s current inventory to gray stained glass pane named "&8"
  33. set slot {_count} - loop-value of {_p}'s current inventory to gray stained glass pane named "&8"
  34.  
  35. loop 4 times:
  36. set slot 9*loop-value of {_p}'s current inventory to gray stained glass pane named "&8"
  37. set slot 9*loop-value - 1 of {_p}'s current inventory to gray stained glass pane named "&8"
  38.  
  39. if {quarry.list.%{_loc}%.enabled} is true:
  40. set slot 21 of {_p}'s current inventory to lime shulker box named "&aEnabled"
  41. set slot 23 of {_p}'s current inventory to red shulker box named "&cDisable"
  42. else:
  43. set slot 21 of {_p}'s current inventory to lime shulker box named "&aEnable"
  44. set slot 23 of {_p}'s current inventory to red shulker box named "&cDisabled"
  45.  
  46. on rightclick on daylight detector:
  47. if checkQuarry(player, location of clicked block):
  48. cancel event
  49. quarryGUI(player, location of clicked block)
  50.  
  51. on inventory click:
  52. if inventory name of player's current inventory is "Quarry":
  53. cancel event
  54. if clicked slot is 21:
  55. if name of clicked item is "&aEnable":
  56. set {quarry.list.%{quarry.open.%player%}%.enabled} to true
  57. set slot 21 of player's current inventory to lime shulker box named "&aEnabled"
  58. set slot 23 of player's current inventory to red shulker box named "&cDisable"
  59. #CHECK SET AND SET INTO VARIABLE
  60. play "ENTITY_PLAYER_LEVELUP" to player at volume 10
  61. else:
  62. play "ENTITY_ITEM_BREAK" to player at volume 10
Add Comment
Please, Sign In to add comment