Advertisement
StarBunnie

Untitled

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