Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- #Title for chat an gui
- bantitle: &cBan &8|
- #Main color
- banc1: &c
- #Glass color in gui
- banglass: red
- on rightclick on player:
- player has permission "bangui.use":
- bangui(player, clicked player)
- command /bangui [<offlineplayer>]:
- trigger:
- player has permission "bangui.use":
- if arg 1 is set:
- bangui(player, arg 1)
- else:
- send "{@bantitle} &7Please write who you want to moderate!"
- else:
- send "{@bantitle} &cYou don't have the required permissions!"
- on join:
- set {bangui::%player's uuid%::prefix} to player's prefix
- set {_perms::*} to permissions of player
- if "%{_perms::*}%" contains "weight.":
- loop {_perms::*}:
- if loop-value contains "weight.":
- set {_weight::*} to loop-value split at "."
- set {bangui::%player's uuid%::weight} to {_weight::2} parsed as integer
- function bangui(p: player, sp: offlineplayer):
- set {_pid} to uuid of {_p}
- set {_spid} to uuid of {_sp}
- set metadata tag "banGUI" of {_p} to chest inventory with 2 row named "{@bantitle} {@banc1}%{_sp}%"
- set slot integers between 0 and 17 of metadata tag "banGUI" of {_p} to {@banglass} stained glass pane named " "
- if {bangui::%{_spid}%::weight} is not set:
- set {_perms::*} to permissions of {_sp}
- if "%{_perms::*}%" contains "weight.":
- loop {_perms::*}:
- if loop-value contains "weight.":
- set {_weight::*} to loop-value split at "."
- set {_weight} to {_weight::2}
- else:
- set {_weight} to 0
- else:
- set {_weight} to {bangui::%{_spid}%::weight}
- 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}%"
- 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"
- if {bangui::%{_spid}%::mute} = true:
- set {_mutestatus} to "{@banc1}Muted"
- else:
- set {_mutestatus} to "{@banc1}Unmuted"
- 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}%"
- 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)"
- 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)"
- 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)"
- 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"
- open (metadata tag "banGUI" of {_p}) to {_p}
- on inventory click:
- if player's current inventory = (metadata tag "banGUI" of player):
- cancel event
- index of event-slot > -1:
- set {_p::*} to name of player's current inventory split at "{@banc1}"
- set {_p} to uncolored {_p::3} parsed as offlineplayer
- set {_pid} to uuid of {_p}
- if {bangui::%{_pid}%::weight} is not set:
- set {_perms::*} to permissions of {_p}
- if "%{_perms::*}%" contains "weight.":
- loop {_perms::*}:
- if loop-value contains "weight.":
- set {_weight::*} to loop-value split at "."
- set {_weight} to {_weight::2} parsed as integer
- else:
- set {_weight} to 0
- else:
- set {_weight} to {bangui::%{_pid}%::weight}
- if {bangui::%player's uuid%::weight} is not set:
- set {_weight2} to 0
- else:
- set {_weight2} to {bangui::%player's uuid%::weight}
- if {_weight2} > {_weight}:
- index of event-slot = 1:
- if event-click type = left mouse button:
- if {bangui::%{_pid}%::mute} is not set:
- set {bangui::%{_pid}%::mute} to true
- send "{@bantitle} {@banc1}%{_p}% &7has now been muted!"
- if {bangui::%player's uuid%::actiontype} is not "Silent":
- send "{@bantitle} {@banc1}%player% &7muted you!" to {_p}
- else:
- send "{@bantitle} {@banc1}%{_p}% &7is already muted!"
- if event-click type = right mouse button:
- if {bangui::%{_pid}%::mute} is not set:
- send "{@bantitle} {@banc1}%{_p}% &7is not muted!"
- else:
- send "{@bantitle} {@banc1}%{_p}% &7is now unmuted!"
- delete {bangui::%{_pid}%::mute}
- if {bangui::%player's uuid%::actiontype} is not "Silent":
- send "{@bantitle} {@banc1}%player% &7unmuted you!" to {_p}
- if {bangui::%{_pid}%::mute} = true:
- set {_mutestatus} to "{@banc1}Muted"
- else:
- set {_mutestatus} to "{@banc1}Unmuted"
- 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}%"
- index of event-slot = 2:
- set {bangui::%player's uuid%::writingreason} to true
- set {bangui::%player's uuid%::accused} to {_p}
- set {bangui::%player's uuid%::punishmenttype} to "kick"
- send "{@bantitle} &7You're about to kick {@banc1}%{_p}%&7!"
- send "{@bantitle} &7Please write a reason for the kick! &8&o(punch to cancel)"
- close player's inventory
- index of event-slot = 6:
- set {bangui::%player's uuid%::writingreason} to true
- set {bangui::%player's uuid%::accused} to {_p}
- set {bangui::%player's uuid%::punishmenttype} to "ban"
- send "{@bantitle} &7You're about to ban {@banc1}%{_p}%&7!"
- send "{@bantitle} &7Please write a reason for the ban! &8&o(punch to cancel)"
- close player's inventory
- index of event-slot = 7:
- set {bangui::%player's uuid%::writingreason} to true
- set {bangui::%player's uuid%::accused} to {_p}
- set {bangui::%player's uuid%::punishmenttype} to "warn"
- send "{@bantitle} &7You're about to warn {@banc1}%{_p}%&7!"
- send "{@bantitle} &7Please write a reason for the warn! &8&o(punch to cancel)"
- close player's inventory
- index of event-slot = 11:
- if event-click type = left mouse button:
- if size of {bangui::%{_pid}%::warns::*} > 0:
- send "{@bantitle} &7Here is a list of all warns regarding {@banc1}%{_p}%&7:"
- send " "
- loop {bangui::%{_pid}%::warns::*}:
- send "&7○ %loop-value%"
- close player's inventory
- else:
- send "{@bantitle} &7Seems like {@banc1}%{_p}% &7doesn't have any warnings yet!"
- else:
- if size of {bangui::%{_pid}%::warns::*} > 0:
- send "{@bantitle} &7You deleted all warns from {@banc1}%{_p}%&7!"
- delete {bangui::%{_pid}%::warns::*}
- else:
- send "{@bantitle} &7Seems like {@banc1}%{_p}% &7doesn't have any warnings yet!"
- index of event-slot = 13:
- if {bangui::%player's uuid%::actiontype} is not set:
- set {bangui::%player's uuid%::actiontype} to "Silent"
- else:
- delete {bangui::%player's uuid%::actiontype}
- 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"
- else:
- send "{@bantitle} {@banc1}%{_p}% &7has a higher rank than you!"
- #
- # Block chat if player is muted
- #
- # Block chat to write the reason
- #
- # Keep in mind if another skript of yours contains an "on chat:" event with a cancel you have to integrate it into that one
- #
- on chat:
- if {bangui::%player's uuid%::mute} = true:
- cancel event
- send "{@bantitle} &7You're muted!"
- if {bangui::%player's uuid%::writingreason} = true:
- cancel event
- if {bangui::%player's uuid%::punishmenttype} = "kick":
- kick {bangui::%player's uuid%::accused} due to "&7You've been kicked by {@banc1}%player%&7!%nl%%nl%&7Reason: {@banc1}%message%"
- if {bangui::%player's uuid%::actiontype} is not "Silent":
- send "{@bantitle} {@banc1}%{bangui::%player's uuid%::accused}% &7has been kicked by {@banc1}%player%&7!" to all players
- send "{@bantitle} &7Reason: {@banc1}%message%" to all players
- if {bangui::%player's uuid%::punishmenttype} = "ban":
- ban {bangui::%player's uuid%::accused} due to "&7You've been banned by {@banc1}%player%&7!%nl%%nl%&7Reason: {@banc1}%message%"
- kick {bangui::%player's uuid%::accused} due to "&7You've been banned by {@banc1}%player%&7!%nl%%nl%&7Reason: {@banc1}%message%"
- if {bangui::%player's uuid%::actiontype} is not "Silent":
- send "{@bantitle} {@banc1}%{bangui::%player's uuid%::accused}% &7has been banned by {@banc1}%player%&7!" to all players
- send "{@bantitle} &7Reason: {@banc1}%message%" to all players
- if {bangui::%player's uuid%::punishmenttype} = "warn":
- set {_spid} to uuid of {bangui::%player's uuid%::accused}
- add "&7Warn &8| &7Reason: {@banc1}%message% &8| &7Time: {@banc1}%now% &8| &7By: {@banc1}%player%" to {bangui::%{_spid}%::warns::*}
- if {bangui::%player's uuid%::actiontype} is not "Silent":
- send "{@bantitle} &7You've been warned by {@banc1}%player%&7! For {@banc1}%message%&7!" to {bangui::%player's uuid%::accused}
- 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}%"]
- send "{@bantitle} &7Reason: {@banc1}%message%" to all players where [input is not equal to "%{bangui::%player's uuid%::accused}%"]
- delete {bangui::%player's uuid%::writingreason}
- delete {bangui::%player's uuid%::accused}
- delete {bangui::%player's uuid%::punishmenttype}
- on leftclick:
- if {bangui::%player's uuid%::writingreason} = true:
- delete {bangui::%player's uuid%::writingreason}
- delete {bangui::%player's uuid%::accused}
- delete {bangui::%player's uuid%::punishmenttype}
- send "{@bantitle} &7Your action has been cancelled!"
- on quit:
- if {bangui::%player's uuid%::writingreason} = true:
- delete {bangui::%player's uuid%::writingreason}
- delete {bangui::%player's uuid%::accused}
- delete {bangui::%player's uuid%::punishmenttype}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement