Advertisement
StarBunnie

Untitled

Jun 14th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.05 KB | None | 0 0
  1. options:
  2. #Titles that is displayed in chat and the gui
  3. #Title for the report GUI
  4. titlerep: <##ff4d4d>Report &8|
  5. #Title for the moderation GUI
  6. titlemod: <##159753>Moderate &8|
  7. #Color for the report GUI
  8. c1: <##ff4d4d>
  9. #Color for the mod GUI
  10. c2: <##159753>
  11. #Glass color | only use 1 of the 16 base colors of minecraft
  12. #Reportgui
  13. glass1: red
  14. #Modgui
  15. glass2: green
  16. #Report reasons
  17. report1: Hacking
  18. report2: Bug Abuse
  19. report3: Autoclicker
  20. report4: Insults
  21. report5: Other
  22. #Cooldown | The time a player has to wait before filing a new report
  23. cooldown: 10 minutes
  24.  
  25. command /report [<offlineplayer>]:
  26. trigger:
  27. playerGUI(player, arg 1, "report")
  28. send "{@titlerep} &7Opening report menu for {@c1}%arg 1%&7..."
  29.  
  30. command /moderate [<offlineplayer>]:
  31. trigger:
  32. player has permission "staffgui.use":
  33. playerGUI(player, arg 1, "moderation")
  34. send "{@titlemod} &7Opening moderation menu for {@c2}%arg 1%&7..."
  35.  
  36. on rightclick on player:
  37. player has permission "staffgui.use":
  38. playerGUI(player, clicked entity, "moderation")
  39. else:
  40. playerGUI(player, clicked entity, "report")
  41.  
  42. function playerGUI(p: player, sp: player, t: text):
  43. set {_pid} to uuid of {_sp}
  44. if {_t} = "moderation":
  45. {_p} has permission "staffgui.use":
  46. set metadata tag "playerModGUI" of {_p} to chest inventory with 1 row named "{@titlemod} {@c2}%{_sp}%"
  47. set slot integers between 0 and 8 of metadata tag "playerModGUI" of {_p} to {@glass2} stained glass pane named " "
  48. set slot 1 of metadata tag "playerModGUI" of {_p} to head of {_sp} named "&7Currently moderating: {@c2}%{_sp}%"
  49. set slot 3 of metadata tag "playerModGUI" of {_p} to book named "{@c2}%{_sp}%&7's reports:" with lore "", "&7{@report1}: {@c2}%{playergui::%{_pid}%::report1} ? 0%", "&7{@report2}: {@c2}%{playergui::%{_pid}%::report2} ? 0%", "&7{@report3}: {@c2}%{playergui::%{_pid}%::report3} ? 0%", "&7{@report4}: {@c2}%{playergui::%{_pid}%::report4} ? 0%", "&7{@report5}: {@c2}%{playergui::%{_pid}%::report5} ? 0%", "" and "&7○ {@c2}&oClick &7&oto clear"
  50. set slot 4 of metadata tag "playerModGUI" of {_p} to oak sign named "&7Mute {@c2}%{_sp}%:" with lore "", "&7○ {@c2}&oLeft click &7&oto mute {@c2}&o%{_sp}%", "&7○ {@c2}&oRight click &7&oto unmute {@c2}&o%{_sp}%", "" and "&7&o(Reason in next step)"
  51. set slot 5 of metadata tag "playerModGUI" of {_p} to piston named "&7Kick {@c2}%{_sp}%" with lore "", "&7○ {@c2}&oClick &7&oto kick {@c2}&o%{_sp}%", "" and "&7&o(Reason in next step)"
  52. set slot 6 of metadata tag "playerModGUI" of {_p} to tnt named "&7Ban {@c2}%{_sp}%" with lore "", "&7○ {@c2}&oClick &7&oto ban {@c2}&o%{_sp}%", "" and "&7&o(Reason in next step)"
  53. set slot 7 of metadata tag "playerModGUI" of {_p} to paper named "&7Open the report menu for {@c2}%{_sp}%&7..."
  54. open (metadata tag "playerModGUI" of {_p}) to {_p}
  55. else if {_t} = "report":
  56. set metadata tag "playerRepGUI" of {_p} to chest inventory with 1 row named "{@titlerep} {@c1}%{_sp}%"
  57. set slot integers between 0 and 8 of metadata tag "playerRepGUI" of {_p} to {@glass1} stained glass pane named " "
  58. set slot 1 of metadata tag "playerRepGUI" of {_p} to head of {_sp} named "&7Currently reporting: {@c1}%{_sp}%"
  59. set slot 3 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report1}"
  60. set slot 4 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report2}"
  61. set slot 5 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report3}"
  62. set slot 6 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report4}"
  63. set slot 7 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report5}"
  64. open (metadata tag "playerRepGUI" of {_p}) to {_p}
  65.  
  66. on inventory click:
  67. if player's current inventory = (metadata tag "playerRepGUI" of player):
  68. cancel event
  69. index of event-slot = 3, 4, 5, 6 or 7:
  70. if {playergui::%player's uuid%::reportcooldown} is not set:
  71. set {playergui::%player's uuid%::reportcooldown} to {@cooldown} and 10 seconds ago
  72. if difference between {playergui::%player's uuid%::reportcooldown} and now is more than {@cooldown}:
  73. set {_name::*} to uncolored name of player's current inventory split at " "
  74. set {_x} to size of {_name::*}
  75. set {_name} to {_name::%{_x}%} parsed as player
  76. set {_nameid} to uuid of {_name}
  77. if index of event-slot = 3:
  78. add 1 to {playergui::%{_nameid}%::report1}
  79. set {_reportreason} to "{@report1}"
  80. if index of event-slot = 4:
  81. add 1 to {playergui::%{_nameid}%::report2}
  82. set {_reportreason} to "{@report2}"
  83. if index of event-slot = 5:
  84. add 1 to {playergui::%{_nameid}%::report3}
  85. set {_reportreason} to "{@report3}"
  86. if index of event-slot = 6:
  87. add 1 to {playergui::%{_nameid}%::report4}
  88. set {_reportreason} to "{@report4}"
  89. if index of event-slot = 7:
  90. add 1 to {playergui::%{_nameid}%::report5}
  91. set {_reportreason} to "{@report5}"
  92. player doesn't have permission "staffgui.cooldown.bypass":
  93. set {playergui::%player's uuid%::reportcooldown} to now
  94. send "{@titlerep} &7You &asuccessfully &7reported {@c1}%{_name}% &7for {@c1}%{_reportreason}%&7!"
  95. close player's inventory
  96. else:
  97. set {_wait} to difference between {playergui::%player's uuid%::reportcooldown} and now
  98. set {_wait} to "%difference between {_wait} and {@cooldown}%"
  99. set {_wait} to formatTime("%{_wait}%")
  100. send "{@titlerep} &7You already reported someone less than {@c1}{@cooldown} &7ago! &8&o(Remaining: %{_wait}%&8&o)"
  101. else if player's current inventory = (metadata tag "playerModGUI" of player):
  102. cancel event
  103. index of event-slot = 3, 4, 5, 6 or 7:
  104. set {_name::*} to uncolored name of player's current inventory split at " "
  105. set {_x} to size of {_name::*}
  106. set {_name} to {_name::%{_x}%} parsed as player
  107. set {_nameid} to uuid of {_name}
  108. index of event-slot = 3:
  109. loop 5 times:
  110. delete {playergui::%{_nameid}%::report%loop-value%}
  111. send "{@titlemod} &7All reports for {@c2}%{_name}% &7have been deleted."
  112. set slot 3 of metadata tag "playerModGUI" of {_p} to book named "{@c2}%{_sp}%&7's reports:" with lore "", "&7{@report1}: {@c2}%{playergui::%{_pid}%::report1} ? 0%", "&7{@report2}: {@c2}%{playergui::%{_pid}%::report2} ? 0%", "&7{@report3}: {@c2}%{playergui::%{_pid}%::report3} ? 0%", "&7{@report4}: {@c2}%{playergui::%{_pid}%::report4} ? 0%", "&7{@report5}: {@c2}%{playergui::%{_pid}%::report5} ? 0%", "" and "&7○ {@c2}&oClick &7&oto clear"
  113. index of event-slot = 4:
  114. if click type = left mouse button:
  115. set {playergui::%player's uuid%::decidingreason} to true
  116. set {playergui::%player's uuid%::victim} to "%{_name}%"
  117. set {playergui::%player's uuid%::action} to "mute"
  118. send "{@titlemod} &7Please write the reason as to why you want to mute {@c2}%{_name}%&7. &7&o(Punch to cancel)"
  119. close player's inventory
  120. else if click type = right mouse button:
  121. make player execute command "/unmute %{_name}%"
  122. index of event-slot = 5:
  123. set {playergui::%player's uuid%::decidingreason} to true
  124. set {playergui::%player's uuid%::victim} to "%{_name}%"
  125. set {playergui::%player's uuid%::action} to "kick"
  126. send "{@titlemod} &7Please write the reason as to why you want to kick {@c2}%{_name}%&7. &7&o(Punch to cancel)"
  127. close player's inventory
  128. index of event-slot = 6:
  129. set {playergui::%player's uuid%::decidingreason} to true
  130. set {playergui::%player's uuid%::victim} to "%{_name}%"
  131. set {playergui::%player's uuid%::action} to "ban"
  132. send "{@titlemod} &7Please write the reason as to why you want to ban {@c2}%{_name}%&7. &7&o(Punch to cancel)"
  133. close player's inventory
  134. index of event-slot = 7:
  135. playerGUI(player, {_name}, "report")
  136.  
  137. on chat:
  138. if {playergui::%player's uuid%::decidingreason} = true:
  139. cancel event
  140. if {playergui::%player's uuid%::action} = "ban":
  141. make player execute command "/ban %{playergui::%player's uuid%::victim}% %colored message%"
  142. if {playergui::%player's uuid%::action} = "kick":
  143. make player execute command "/kick %{playergui::%player's uuid%::victim}% %colored message%"
  144. if {playergui::%player's uuid%::action} = "mute":
  145. make player execute command "/mute %{playergui::%player's uuid%::victim}% %colored message%"
  146. delete {playergui::%player's uuid%::victim}
  147. delete {playergui::%player's uuid%::action}
  148. delete {playergui::%player's uuid%::decidingreason}
  149.  
  150. on leftclick:
  151. if {playergui::%player's uuid%::decidingreason} = true:
  152. cancel event
  153. delete {playergui::%player's uuid%::victim}
  154. delete {playergui::%player's uuid%::action}
  155. delete {playergui::%player's uuid%::decidingreason}
  156. send "{@titlemod} &7You cancelled your action!"
  157.  
  158. function formatTime(t: text) :: text:
  159. replace " seconds" in {_t} with "s"
  160. replace " minutes" in {_t} with "m"
  161. replace " hours" in {_t} with "h"
  162. replace " days" in {_t} with "d"
  163. replace " second" in {_t} with "s"
  164. replace " minute" in {_t} with "m"
  165. replace " hour" in {_t} with "h"
  166. replace " day" in {_t} with "d"
  167. replace " and", " and " and "and " in {_t} with ""
  168. return {_t}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement