Advertisement
StarBunnie

Untitled

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