Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- #Titles that is displayed in chat and the gui
- #Title for the report GUI
- titlerep: <##ff4d4d>Report &8|
- #Title for the moderation GUI
- titlemod: <##159753>Moderate &8|
- #Color for the report GUI
- c1: <##ff4d4d>
- #Color for the mod GUI
- c2: <##159753>
- #Glass color | only use 1 of the 16 base colors of minecraft
- #Reportgui
- glass1: red
- #Modgui
- glass2: green
- #Report reasons
- report1: Hacking
- report2: Bug Abuse
- report3: Autoclicker
- report4: Insults
- report5: Other
- #Cooldown | The time a player has to wait before filing a new report
- cooldown: 10 minutes
- command /report [<offlineplayer>]:
- trigger:
- playerGUI(player, arg 1, "report")
- send "{@titlerep} &7Opening report menu for {@c1}%arg 1%&7..."
- command /moderate [<offlineplayer>]:
- trigger:
- player has permission "staffgui.use":
- playerGUI(player, arg 1, "moderation")
- send "{@titlemod} &7Opening moderation menu for {@c2}%arg 1%&7..."
- on rightclick on player:
- player has permission "staffgui.use":
- playerGUI(player, clicked entity, "moderation")
- else:
- playerGUI(player, clicked entity, "report")
- function playerGUI(p: player, sp: player, t: text):
- set {_pid} to uuid of {_sp}
- if {_t} = "moderation":
- {_p} has permission "staffgui.use":
- set metadata tag "playerModGUI" of {_p} to chest inventory with 1 row named "{@titlemod} {@c2}%{_sp}%"
- set slot integers between 0 and 8 of metadata tag "playerModGUI" of {_p} to {@glass2} stained glass pane named " "
- set slot 1 of metadata tag "playerModGUI" of {_p} to head of {_sp} named "&7Currently moderating: {@c2}%{_sp}%"
- 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"
- 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)"
- 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)"
- 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)"
- set slot 7 of metadata tag "playerModGUI" of {_p} to paper named "&7Open the report menu for {@c2}%{_sp}%&7..."
- open (metadata tag "playerModGUI" of {_p}) to {_p}
- else if {_t} = "report":
- set metadata tag "playerRepGUI" of {_p} to chest inventory with 1 row named "{@titlerep} {@c1}%{_sp}%"
- set slot integers between 0 and 8 of metadata tag "playerRepGUI" of {_p} to {@glass1} stained glass pane named " "
- set slot 1 of metadata tag "playerRepGUI" of {_p} to head of {_sp} named "&7Currently reporting: {@c1}%{_sp}%"
- set slot 3 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report1}"
- set slot 4 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report2}"
- set slot 5 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report3}"
- set slot 6 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report4}"
- set slot 7 of metadata tag "playerRepGUI" of {_p} to paper named "&7Report for: {@c1}{@report5}"
- open (metadata tag "playerRepGUI" of {_p}) to {_p}
- on inventory click:
- if player's current inventory = (metadata tag "playerRepGUI" of player):
- cancel event
- index of event-slot = 3, 4, 5, 6 or 7:
- if {playergui::%player's uuid%::reportcooldown} is not set:
- set {playergui::%player's uuid%::reportcooldown} to {@cooldown} and 10 seconds ago
- if difference between {playergui::%player's uuid%::reportcooldown} and now is more than {@cooldown}:
- set {_name::*} to uncolored name of player's current inventory split at " "
- set {_x} to size of {_name::*}
- set {_name} to {_name::%{_x}%} parsed as player
- set {_nameid} to uuid of {_name}
- if index of event-slot = 3:
- add 1 to {playergui::%{_nameid}%::report1}
- set {_reportreason} to "{@report1}"
- if index of event-slot = 4:
- add 1 to {playergui::%{_nameid}%::report2}
- set {_reportreason} to "{@report2}"
- if index of event-slot = 5:
- add 1 to {playergui::%{_nameid}%::report3}
- set {_reportreason} to "{@report3}"
- if index of event-slot = 6:
- add 1 to {playergui::%{_nameid}%::report4}
- set {_reportreason} to "{@report4}"
- if index of event-slot = 7:
- add 1 to {playergui::%{_nameid}%::report5}
- set {_reportreason} to "{@report5}"
- player doesn't have permission "staffgui.cooldown.bypass":
- set {playergui::%player's uuid%::reportcooldown} to now
- send "{@titlerep} &7You &asuccessfully &7reported {@c1}%{_name}% &7for {@c1}%{_reportreason}%&7!"
- close player's inventory
- else:
- set {_wait} to difference between {playergui::%player's uuid%::reportcooldown} and now
- set {_wait} to "%difference between {_wait} and {@cooldown}%"
- set {_wait} to formatTime("%{_wait}%")
- send "{@titlerep} &7You already reported someone less than {@c1}{@cooldown} &7ago! &8&o(Remaining: %{_wait}%&8&o)"
- else if player's current inventory = (metadata tag "playerModGUI" of player):
- cancel event
- index of event-slot = 3, 4, 5, 6 or 7:
- set {_name::*} to uncolored name of player's current inventory split at " "
- set {_x} to size of {_name::*}
- set {_name} to {_name::%{_x}%} parsed as player
- set {_nameid} to uuid of {_name}
- index of event-slot = 3:
- loop 5 times:
- delete {playergui::%{_nameid}%::report%loop-value%}
- send "{@titlemod} &7All reports for {@c2}%{_name}% &7have been deleted."
- 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"
- index of event-slot = 4:
- if click type = left mouse button:
- set {playergui::%player's uuid%::decidingreason} to true
- set {playergui::%player's uuid%::victim} to "%{_name}%"
- set {playergui::%player's uuid%::action} to "mute"
- send "{@titlemod} &7Please write the reason as to why you want to mute {@c2}%{_name}%&7. &7&o(Punch to cancel)"
- close player's inventory
- else if click type = right mouse button:
- make player execute command "/unmute %{_name}%"
- index of event-slot = 5:
- set {playergui::%player's uuid%::decidingreason} to true
- set {playergui::%player's uuid%::victim} to "%{_name}%"
- set {playergui::%player's uuid%::action} to "kick"
- send "{@titlemod} &7Please write the reason as to why you want to kick {@c2}%{_name}%&7. &7&o(Punch to cancel)"
- close player's inventory
- index of event-slot = 6:
- set {playergui::%player's uuid%::decidingreason} to true
- set {playergui::%player's uuid%::victim} to "%{_name}%"
- set {playergui::%player's uuid%::action} to "ban"
- send "{@titlemod} &7Please write the reason as to why you want to ban {@c2}%{_name}%&7. &7&o(Punch to cancel)"
- close player's inventory
- index of event-slot = 7:
- playerGUI(player, {_name}, "report")
- on chat:
- if {playergui::%player's uuid%::decidingreason} = true:
- cancel event
- if {playergui::%player's uuid%::action} = "ban":
- make player execute command "/ban %{playergui::%player's uuid%::victim}% %colored message%"
- if {playergui::%player's uuid%::action} = "kick":
- make player execute command "/kick %{playergui::%player's uuid%::victim}% %colored message%"
- if {playergui::%player's uuid%::action} = "mute":
- make player execute command "/mute %{playergui::%player's uuid%::victim}% %colored message%"
- delete {playergui::%player's uuid%::victim}
- delete {playergui::%player's uuid%::action}
- delete {playergui::%player's uuid%::decidingreason}
- on leftclick:
- if {playergui::%player's uuid%::decidingreason} = true:
- cancel event
- delete {playergui::%player's uuid%::victim}
- delete {playergui::%player's uuid%::action}
- delete {playergui::%player's uuid%::decidingreason}
- send "{@titlemod} &7You cancelled your action!"
- function formatTime(t: text) :: text:
- replace " seconds" in {_t} with "s"
- replace " minutes" in {_t} with "m"
- replace " hours" in {_t} with "h"
- replace " days" in {_t} with "d"
- replace " second" in {_t} with "s"
- replace " minute" in {_t} with "m"
- replace " hour" in {_t} with "h"
- replace " day" in {_t} with "d"
- replace " and", " and " and "and " in {_t} with ""
- return {_t}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement