Advertisement
StarBunnie

Untitled

Jun 23rd, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.49 KB | None | 0 0
  1. options:
  2. #Title for chat an gui
  3. bantitle: &cBan &8|
  4. #Main color
  5. banc1: &c
  6. #Glass color in gui
  7. banglass: red
  8.  
  9. on rightclick on player:
  10. player has permission "bangui.use":
  11. bangui(player, clicked player)
  12.  
  13. command /bangui [<offlineplayer>]:
  14. trigger:
  15. player has permission "bangui.use":
  16. if arg 1 is set:
  17. bangui(player, arg 1)
  18. else:
  19. send "{@bantitle} &7Please write who you want to moderate!"
  20. else:
  21. send "{@bantitle} &cYou don't have the required permissions!"
  22.  
  23. on join:
  24. set {bangui::%player's uuid%::prefix} to player's prefix
  25. set {_perms::*} to permissions of player
  26. if "%{_perms::*}%" contains "weight.":
  27. loop {_perms::*}:
  28. if loop-value contains "weight.":
  29. set {_weight::*} to loop-value split at "."
  30. set {bangui::%player's uuid%::weight} to {_weight::2} parsed as integer
  31.  
  32. function bangui(p: player, sp: offlineplayer):
  33. set {_pid} to uuid of {_p}
  34. set {_spid} to uuid of {_sp}
  35. set metadata tag "banGUI" of {_p} to chest inventory with 2 row named "{@bantitle} {@banc1}%{_sp}%"
  36. set slot integers between 0 and 17 of metadata tag "banGUI" of {_p} to {@banglass} stained glass pane named " "
  37. if {bangui::%{_spid}%::weight} is not set:
  38. set {_perms::*} to permissions of {_sp}
  39. if "%{_perms::*}%" contains "weight.":
  40. loop {_perms::*}:
  41. if loop-value contains "weight.":
  42. set {_weight::*} to loop-value split at "."
  43. set {_weight} to {_weight::2}
  44. else:
  45. set {_weight} to 0
  46. else:
  47. set {_weight} to {bangui::%{_spid}%::weight}
  48. set slot 4 of metadata tag "banGUI" of {_p} to head of {_sp} named "&7Currently moderating: {@banc1}%{_sp}%" with lore "", "{@banc1}%{_sp}%&7's rank: %{bangui::%{_spid}%::prefix}%" and "{@banc1}%{_sp}%&7's perm level: {@banc1}%{_weight}%"
  49. set slot 13 of metadata tag "banGUI" of {_p} to note block named "&7Current action type: {@banc1}%{bangui::%{_pid}%::actiontype} ? ""Non-silent""%" with lore "" and "&7○ {@banc1}&oClick &7&oto toggle"
  50. if {bangui::%{_spid}%::mute} = true:
  51. set {_mutestatus} to "{@banc1}Muted"
  52. else:
  53. set {_mutestatus} to "{@banc1}Unmuted"
  54. set slot 1 of metadata tag "banGUI" of {_p} to oak sign named "&7Mute {@banc1}%{_sp}%" with lore "", "&7Current status: %{_mutestatus}%", "", "&7○ {@banc1}&oLeft click &7&oto mute {@banc1}&o%{_sp}%" and "&7○ {@banc1}&oRight click &7&oto unmute {@banc1}&o%{_sp}%"
  55. set slot 2 of metadata tag "banGUI" of {_p} to piston named "&7Kick {@banc1}%{_sp}%" with lore "", "&7○ {@banc1}&oClick &7&oto kick {@banc1}&o%{_sp}%", "" and "&7&o(Reason in next step)"
  56. set slot 6 of metadata tag "banGUI" of {_p} to tnt named "&7Ban {@banc1}%{_sp}%" with lore "", "&7○ {@banc1}&oClick &7&oto ban {@banc1}&o%{_sp}%", "" and "&7&o(Reason in next step)"
  57. set slot 7 of metadata tag "banGUI" of {_p} to paper named "&7Warn {@banc1}%{_sp}%" with lore "", "&7○ {@banc1}&oClick &7&oto warn {@banc1}&o%{_sp}%", "" and "&7&o(Reason in next step)"
  58. set slot 11 of metadata tag "banGUI" of {_p} to book and quill named "&7View the warns of {@banc1}%{_sp}%&7..." with lore "" and "&7Amount of warns: {@banc1}%size of {bangui::%{_spid}%::warns::*}%", "", "&7○ {@banc1}&oLeft click &7&oto view all warns" and "&7○ {@banc1}&oRight click &7&oto delete all warns"
  59. open (metadata tag "banGUI" of {_p}) to {_p}
  60.  
  61. on inventory click:
  62. if player's current inventory = (metadata tag "banGUI" of player):
  63. cancel event
  64. index of event-slot > -1:
  65. set {_p::*} to name of player's current inventory split at "{@banc1}"
  66. set {_p} to uncolored {_p::3} parsed as offlineplayer
  67. set {_pid} to uuid of {_p}
  68. if {bangui::%{_pid}%::weight} is not set:
  69. set {_perms::*} to permissions of {_p}
  70. if "%{_perms::*}%" contains "weight.":
  71. loop {_perms::*}:
  72. if loop-value contains "weight.":
  73. set {_weight::*} to loop-value split at "."
  74. set {_weight} to {_weight::2} parsed as integer
  75. else:
  76. set {_weight} to 0
  77. else:
  78. set {_weight} to {bangui::%{_pid}%::weight}
  79. if {bangui::%player's uuid%::weight} is not set:
  80. set {_weight2} to 0
  81. else:
  82. set {_weight2} to {bangui::%player's uuid%::weight}
  83. if {_weight2} > {_weight}:
  84. index of event-slot = 1:
  85. if event-click type = left mouse button:
  86. if {bangui::%{_pid}%::mute} is not set:
  87. set {bangui::%{_pid}%::mute} to true
  88. send "{@bantitle} {@banc1}%{_p}% &7has now been muted!"
  89. if {bangui::%player's uuid%::actiontype} is not "Silent":
  90. send "{@bantitle} {@banc1}%player% &7muted you!" to {_p}
  91. else:
  92. send "{@bantitle} {@banc1}%{_p}% &7is already muted!"
  93. if event-click type = right mouse button:
  94. if {bangui::%{_pid}%::mute} is not set:
  95. send "{@bantitle} {@banc1}%{_p}% &7is not muted!"
  96. else:
  97. send "{@bantitle} {@banc1}%{_p}% &7is now unmuted!"
  98. delete {bangui::%{_pid}%::mute}
  99. if {bangui::%player's uuid%::actiontype} is not "Silent":
  100. send "{@bantitle} {@banc1}%player% &7unmuted you!" to {_p}
  101. if {bangui::%{_pid}%::mute} = true:
  102. set {_mutestatus} to "{@banc1}Muted"
  103. else:
  104. set {_mutestatus} to "{@banc1}Unmuted"
  105. set slot 1 of player's current inventory to oak sign named "&7Mute {@banc1}%{_p}%:" with lore "", "&7Current status: %{_mutestatus}%", "", "&7○ {@banc1}&oLeft click &7&oto mute {@banc1}&o%{_p}%" and "&7○ {@banc1}&oRight click &7&oto unmute {@banc1}&o%{_p}%"
  106. index of event-slot = 2:
  107. set {bangui::%player's uuid%::writingreason} to true
  108. set {bangui::%player's uuid%::accused} to {_p}
  109. set {bangui::%player's uuid%::punishmenttype} to "kick"
  110. send "{@bantitle} &7You're about to kick {@banc1}%{_p}%&7!"
  111. send "{@bantitle} &7Please write a reason for the kick! &8&o(punch to cancel)"
  112. close player's inventory
  113. index of event-slot = 6:
  114. set {bangui::%player's uuid%::writingreason} to true
  115. set {bangui::%player's uuid%::accused} to {_p}
  116. set {bangui::%player's uuid%::punishmenttype} to "ban"
  117. send "{@bantitle} &7You're about to ban {@banc1}%{_p}%&7!"
  118. send "{@bantitle} &7Please write a reason for the ban! &8&o(punch to cancel)"
  119. close player's inventory
  120. index of event-slot = 7:
  121. set {bangui::%player's uuid%::writingreason} to true
  122. set {bangui::%player's uuid%::accused} to {_p}
  123. set {bangui::%player's uuid%::punishmenttype} to "warn"
  124. send "{@bantitle} &7You're about to warn {@banc1}%{_p}%&7!"
  125. send "{@bantitle} &7Please write a reason for the warn! &8&o(punch to cancel)"
  126. close player's inventory
  127. index of event-slot = 11:
  128. if event-click type = left mouse button:
  129. if size of {bangui::%{_pid}%::warns::*} > 0:
  130. send "{@bantitle} &7Here is a list of all warns regarding {@banc1}%{_p}%&7:"
  131. send " "
  132. loop {bangui::%{_pid}%::warns::*}:
  133. send "&7○ %loop-value%"
  134. close player's inventory
  135. else:
  136. send "{@bantitle} &7Seems like {@banc1}%{_p}% &7doesn't have any warnings yet!"
  137. else:
  138. if size of {bangui::%{_pid}%::warns::*} > 0:
  139. send "{@bantitle} &7You deleted all warns from {@banc1}%{_p}%&7!"
  140. delete {bangui::%{_pid}%::warns::*}
  141. else:
  142. send "{@bantitle} &7Seems like {@banc1}%{_p}% &7doesn't have any warnings yet!"
  143. index of event-slot = 13:
  144. if {bangui::%player's uuid%::actiontype} is not set:
  145. set {bangui::%player's uuid%::actiontype} to "Silent"
  146. else:
  147. delete {bangui::%player's uuid%::actiontype}
  148. set slot 13 of player's current inventory to note block named "&7Current action type: {@banc1}%{bangui::%player's uuid%::actiontype} ? ""Non-silent""%" with lore "" and "&7○ {@banc1}&oClick &7&oto toggle"
  149. else:
  150. send "{@bantitle} {@banc1}%{_p}% &7has a higher rank than you!"
  151.  
  152. #
  153. # Block chat if player is muted
  154. #
  155. # Block chat to write the reason
  156. #
  157. # Keep in mind if another skript of yours contains an "on chat:" event with a cancel you have to integrate it into that one
  158. #
  159.  
  160. on chat:
  161. if {bangui::%player's uuid%::mute} = true:
  162. cancel event
  163. send "{@bantitle} &7You're muted!"
  164. if {bangui::%player's uuid%::writingreason} = true:
  165. cancel event
  166. if {bangui::%player's uuid%::punishmenttype} = "kick":
  167. kick {bangui::%player's uuid%::accused} due to "&7You've been kicked by {@banc1}%player%&7!%nl%%nl%&7Reason: {@banc1}%message%"
  168. if {bangui::%player's uuid%::actiontype} is not "Silent":
  169. send "{@bantitle} {@banc1}%{bangui::%player's uuid%::accused}% &7has been kicked by {@banc1}%player%&7!" to all players
  170. send "{@bantitle} &7Reason: {@banc1}%message%" to all players
  171. if {bangui::%player's uuid%::punishmenttype} = "ban":
  172. ban {bangui::%player's uuid%::accused} due to "&7You've been banned by {@banc1}%player%&7!%nl%%nl%&7Reason: {@banc1}%message%"
  173. kick {bangui::%player's uuid%::accused} due to "&7You've been banned by {@banc1}%player%&7!%nl%%nl%&7Reason: {@banc1}%message%"
  174. if {bangui::%player's uuid%::actiontype} is not "Silent":
  175. send "{@bantitle} {@banc1}%{bangui::%player's uuid%::accused}% &7has been banned by {@banc1}%player%&7!" to all players
  176. send "{@bantitle} &7Reason: {@banc1}%message%" to all players
  177. if {bangui::%player's uuid%::punishmenttype} = "warn":
  178. set {_spid} to uuid of {bangui::%player's uuid%::accused}
  179. add "&7Warn &8| &7Reason: {@banc1}%message% &8| &7Time: {@banc1}%now% &8| &7By: {@banc1}%player%" to {bangui::%{_spid}%::warns::*}
  180. if {bangui::%player's uuid%::actiontype} is not "Silent":
  181. send "{@bantitle} &7You've been warned by {@banc1}%player%&7! For {@banc1}%message%&7!" to {bangui::%player's uuid%::accused}
  182. send "{@bantitle} {@banc1}%{bangui::%player's uuid%::accused}% &7has been warned by {@banc1}%player%&7!" to all players where [input is not equal to "%{bangui::%player's uuid%::accused}%"]
  183. send "{@bantitle} &7Reason: {@banc1}%message%" to all players where [input is not equal to "%{bangui::%player's uuid%::accused}%"]
  184. delete {bangui::%player's uuid%::writingreason}
  185. delete {bangui::%player's uuid%::accused}
  186. delete {bangui::%player's uuid%::punishmenttype}
  187.  
  188. on leftclick:
  189. if {bangui::%player's uuid%::writingreason} = true:
  190. delete {bangui::%player's uuid%::writingreason}
  191. delete {bangui::%player's uuid%::accused}
  192. delete {bangui::%player's uuid%::punishmenttype}
  193. send "{@bantitle} &7Your action has been cancelled!"
  194.  
  195. on quit:
  196. if {bangui::%player's uuid%::writingreason} = true:
  197. delete {bangui::%player's uuid%::writingreason}
  198. delete {bangui::%player's uuid%::accused}
  199. delete {bangui::%player's uuid%::punishmenttype}
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement