Files
spawn.sk
staffmode.sk
Code
2 109
staffmode.sk
# Staff Mode Script
# Place in plugins/Skript/scripts/
# /staffmode - Toggle staff inspection mode
# Right-click a player while in staff mode to ban them for 30 days
options:
prefix: &8[&cStaff&8]&r
permission: staff.mode
ban-duration: 30 days
on script load:
send "{@prefix} &aStaff Mode script loaded." to console
function giveStaffItems(p: player):
clear {_p}'s inventory
set slot 0 of {_p}'s inventory to red dye named "&c&lFly" with lore "&7Click a player to ban for fly hacks"
set slot 1 of {_p}'s inventory to orange dye named "&6&lMovement" with lore "&7Click a player to ban for movement hacks"
set slot 2 of {_p}'s inventory to yellow dye named "&e&lCheats" with lore "&7Click a player to ban for cheating"
set slot 3 of {_p}'s inventory to green dye named "&a&lKillAura" with lore "&7Click a player to ban for kill aura"
set slot 4 of {_p}'s inventory to blue dye named "&9&lAutoClicker" with lore "&7Click a player to ban for auto clicking"
set slot 5 of {_p}'s inventory to purple dye named "&5&lMacro" with lore "&7Click a player to ban for macro"
set slot 6 of {_p}'s inventory to cyan dye named "&b&lAntiKnockback" with lore "&7Click a player to ban for anti-knockback"
set slot 7 of {_p}'s inventory to pink dye named "&d&lESP" with lore "&7Click a player to ban for esp"
set slot 8 of {_p}'s inventory to white dye named "&f&lOther" with lore "&7Click a player to ban for other hacks"
command /staffmode:
permission: {@permission}
permission message: &cYou don't have permission to use staff mode.
trigger:
if {staffmode::%player's uuid%} is true:
# Disable staff mode
set {staffmode::%player's uuid%} to false
remove invisibility from player
clear player's inventory
loop {staffinv::%player's uuid%::*}:
add loop-value to player's inventory
delete {staffinv::%player's uuid%::*}
send "{@prefix} &cStaff mode &ldisabled&r&c." to player
else:
# Enable staff mode
set {staffmode::%player's uuid%} to true
# Save current inventory
delete {staffinv::%player's uuid%::*}
loop player's inventory:
if loop-value is not air:
add loop-value to {staffinv::%player's uuid%::*}
giveStaffItems(player)
apply invisibility to player for 999999 days
send "{@prefix} &aStaff mode &lenabled&r&a. Right-click players to ban them." to player
on right click on player:
if {staffmode::%player's uuid%} is true:
set {_target} to clicked entity
if {_target} is a player:
set {_tool} to player's tool
set {_reason} to "Hacking"
if name of {_tool} contains "Fly":
set {_reason} to "Fly Hacks"
else if name of {_tool} contains "Movement":
set {_reason} to "Movement Hacks"
else if name of {_tool} contains "Cheats":
set {_reason} to "Cheating"
else if name of {_tool} contains "KillAura":
set {_reason} to "Kill Aura"
else if name of {_tool} contains "AutoClicker":
set {_reason} to "Auto Clicking"
else if name of {_tool} contains "Macro":
set {_reason} to "Macro"
else if name of {_tool} contains "AntiKnockback":
set {_reason} to "Anti-Knockback"
else if name of {_tool} contains "Scaffold":
set {_reason} to "Scaffold"
else if name of {_tool} contains "Other":
set {_reason} to "Hacking"
ban {_target} for 30 days due to "Banned by staff for: %{_reason}%"
send "{@prefix} &aYou banned &e%{_target}% &afor &e30 days &adue to &e%{_reason}%&a." to player
broadcast "{@prefix} &e%{_target}% &chas been banned for &e30 days &cby &e%player% &cfor &e%{_reason}%&c."
on quit:
if {staffmode::%player's uuid%} is true:
set {staffmode::%player's uuid%} to false
delete {staffinv::%player's uuid%::*}