Advertisement
1c7

WorldGUI

1c7
Apr 30th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.68 KB | None | 0 0
  1. options:
  2.  
  3. spawn-with-selector: true # Give player's the world selector on join.
  4.  
  5. selector-item: nether star # Item to act as the world selector (above must be 'true')
  6.  
  7. gui-rows: 1 # How many rows the /world GUI uses.
  8.  
  9. logs: true # Decide whether to log player's movements using the WorldGUI.
  10.  
  11.  
  12.  
  13.  
  14. P: &7[&cWorld&lGUI&7] # PREFIX - DO NOT EDIT
  15.  
  16.  
  17. on script load:
  18. if {wgui::worlds::*} is not set:
  19. add "" to {wgui::worlds::*}
  20.  
  21. on join:
  22. if {@spawn-with-selector} is true:
  23. give player 1 {@selector-item} named "{@P} World Selector"
  24.  
  25. on click holding {@selector-item}:
  26. player command "world"
  27.  
  28. command /world:
  29. permission: worldgui.use
  30. trigger:
  31. remove "" from {wgui::worlds::*}
  32. open chest with {@gui-rows} rows named "Select a world to join." to player
  33. set {_slot} to 0
  34. loop {wgui::worlds::*}:
  35. set slot {_slot} of player's current inventory to {wgui::icon::world::%loop-value%} named "%loop-value%" with lore "&7MOTD: &e%{wgui::motd::world::%loop-value%}%" and "&7Click to join world &3%loop-value%&7."
  36. add 1 to {_slot}
  37. add "" to {wgui::worlds::*}
  38.  
  39. on inventory click:
  40. if inventory name of player's current inventory is "Select a world to join.":
  41. if name of clicked item is set:
  42. console command "mvtp %player% %name of clicked item%"
  43. send "{@P} Sending you to world &3%name of clicked item%&7."
  44. if {@logs} is true:
  45. log "%player% has teleported to world %name of clicked item% (%time%)" to "worldgui.log"
  46.  
  47. command /worldgui:
  48. aliases: wgui
  49. permission: worldgui.admin
  50. trigger:
  51. open chest with 1 rows named "Please select an option." to player
  52. set slot 2 of player's current inventory to green stained glass pane named "&a&nAdd&a a world" with lore "&7Add a world to the World GUI!"
  53. set slot 6 of player's current inventory to red stained glass pane named "&c&nRemove&c a world" with lore "&7Remove a world from the World GUI!"
  54.  
  55. on inventory click:
  56. if inventory name of player's current inventory is "Please select an option.":
  57. cancel event
  58. if clicked slot is 2:
  59. open chest with 5 rows named "Please select a world to &a&nadd&7." to player
  60. set {_slot} to 0
  61. loop all worlds:
  62. if {wgui::worlds::*} does not contain loop-value:
  63. set slot {_slot} of player's current inventory to grass block named "%loop-value%" with lore "&7Click to &a&nadd&7 world &3%loop-value%&7 to the World GUI."
  64. add 1 to {_slot}
  65. else if clicked slot is 6:
  66. open chest with 5 rows named "Please select a world to &c&nremove&7." to player
  67. set {_slot} to 0
  68. remove "" from {wgui::worlds::*}
  69. loop {wgui::worlds::*}:
  70. set slot {_slot} of player's current inventory to {wgui::icon::world::%loop-value%} named "%loop-value%" with lore "&7Click to &c&nremove&7 world &3%loop-value%&7 to the World GUI."
  71. add 1 to {_slot}
  72. add "" to {wgui::worlds::*}
  73. if inventory name of player's current inventory is "Please select a world to &a&nadd&7.":
  74. cancel event
  75. if name of clicked item is set:
  76. add name of clicked item to {wgui::worlds::*}
  77. send "{@P} &3%name of clicked item%&7 has been added to the World GUI!"
  78. send ""
  79. send "{@P} INFORMATION NEEDED"
  80. send ""
  81. send "&7> &7Please enter in chat the &3&licon&7 for world &3%name of clicked item%&7."
  82. set {wgui::icon::%player's uuid%} to name of clicked item
  83. close player's inventory
  84. if inventory name of player's current inventory is "Please select a world to &c&nremove&7.":
  85. cancel event
  86. if name of clicked item is set:
  87. remove name of clicked item from {wgui::worlds::*}
  88. send "{@P} &3%name of clicked item%&7 has been removed from the World GUI!"
  89. player command "/wgui"
  90.  
  91. on chat:
  92. if {wgui::icon::%player's uuid%} is set:
  93. cancel event
  94. set {wgui::icon::world::%{wgui::icon::%player's uuid%}%} to message parsed as material
  95. send "%{wgui::icon::world::%{wgui::icon::%player's uuid%}%}%"
  96. send "{@P} Complete! &3%{wgui::icon::%player's uuid%}%&7's icon has been set to &3%message%&7! &7&o(Please not if you entered something incorrectly, you will need to remove the world from the GUI, then re-do these steps!)"
  97. set {wgui::motd::%player's uuid%} to {wgui::icon::%player's uuid%}
  98. send "{@P} Now enter the &3&lMOTD&7 for &3%{wgui::icon::%player's uuid%}%&7."
  99. delete {wgui::icon::%player's uuid%}
  100. else if {wgui::motd::%player's uuid%} is set:
  101. cancel event
  102. set {wgui::motd::world::%{wgui::motd::%player's uuid%}%} to message
  103. send "{@P} Setup complete! &3%{wgui::motd::%player's uuid%}%&7's MOTD has been set to &3%message%&7!"
  104. delete {wgui::motd::%player's uuid%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement