Jump to content

Minehut Punishment Replica Skript


Recommended Posts

My friend replicated Minehut's old Punishment system from a few years ago. It included /puns, /tban, /tmute, /mute and /ban. I also added /warn to it because MH is bad an doesn't have it. I have used this on my servers for a while and I thought I would give it to all the future server creators.

 

# DryEvents PUNISHMENTS

# Punish


command /tempban [<offline player>] [<string>] [<text>]:
    aliases: tb, tban 
    trigger:
        if executor has permission "server.mod":
            if arg 3 is not set:
                message "&7Usage: &3/tempban &c<player> <duration> [-s] <reason>"
            else:
                set {_time} to arg 2
                if {_time} contains "s":
                    replace all "s" with " seconds" in {_time}
                else if {_time} contains "m":
                    replace all "m" with " minutes" in {_time}
                else if {_time} contains "h":
                    replace all "h" with " hours" in {_time}
                else if {_time} contains "d":
                    replace all "d" with " days" in {_time}
                set {_time2} to "%{_time}%" parsed as timespan
                replace all "second" with "SECOND" in {_time}
                replace all "seconds" with "SECONDS" in {_time}
                replace all "minute" with "MINUTE" in {_time}
                replace all "minutes" with "MINUTES" in {_time}
                replace all "hour" with "HOUR" in {_time}
                replace all "hours" with "HOURS" in {_time}
                replace all "day" with "DAY" in {_time}
                replace all "days" with "DAYS" in {_time}
                if {_time2} is not a timespan:
                    message "&cInput a valid duration."
                else:
                    loop all offline players where [input is arg 1]:
                        set {_found} to true
                    if {_found} is set:
                        set {_reason} to arg 3 
                        replace all "-s " with "" in {_reason}
                        replace all " -s" with "" in {_reason}
                        replace all "-s" with "" in {_reason}
                        if length of {_reason} is 0:
                            message "&7Usage: &3/tempban &c<player> <duration> [-s] <reason>"
                        else:
                            set {_executor} to "%player%"
                            if executor is not a player:
                                set {_executor} to colored "&cConsole"
                            set {ban::%uuid of arg-1%::date} to now
                            set {ban::%uuid of arg-1%::reason} to uncolored {_reason}
                            set {ban::%uuid of arg-1%::time} to ("%{_time2}%" parsed as timespan)
                            if {ban::%uuid of arg-1%} is set:
                                message "&cPrevious punishment for %arg-1% &cremoved."
                            set {_reason} to arg 3
                            replace all " -s" with "" in {_reason}
                            replace all "-s " with "" in {_reason}
                            replace all "-s" with "" in {_reason}
                            add "&r&3Type: &fBAN &3Staff: &r%{_executor}% &3Issued: &r%{ban::%uuid of arg-1%::date}%%nl%&r&3Length: &f%{ban::%uuid of arg-1%::time}%%nl%&r&3Reason: &r%{_reason}%" to {punish-history.%uuid of arg-1%::*}
                            if arg 3 contains "-s":
                                message "&7[Silent] &3%{_executor}% &7banned &3%arg-1% &7for &c%{_reason}%&7. [%{_time}%&7]" to all players where [input has permission "server.helper"]
                            else:
                                broadcast "&3%{_executor}% &7banned &3%arg-1% &7for &c%{_reason}%&7. [%{_time}%&7]"
                            set {ban::%uuid of arg-1%} to true
                            wait 1 tick 
                            kick arg 1 due to "&cYou are banned from DryEvents.minehut.gg.%nl%%nl%%{ban::%uuid of arg-1%::reason}%%nl%%nl%&7&nThis ban will expire in %{_time2}%."
                    else:
                        message "&c%arg-1% &chas never joined before."


command /ban [<offline player>] [<text>]:
    aliases: b 
    trigger:
        if executor has permission "server.mod":
            if arg 2 is not set:
                message "&7Usage: &3/ban &c<player> [-s] <reason>"
            else:
                loop all offline players where [input is arg 1]:
                    set {_found} to true
                if {_found} is set:
                    set {_reason} to arg 2
                    replace all "-s " with "" in {_reason}
                    replace all " -s" with "" in {_reason}
                    replace all "-s" with "" in {_reason}
                    if length of {_reason} is 0:
                        message "&7Usage: &3/ban &c<player> <duration> [-s] <reason>"
                    else:
                        set {_executor} to "%player%"
                        if executor is not a player:
                            set {_executor} to colored "&cConsole"
                        set {ban::%uuid of arg-1%::date} to now
                        set {ban::%uuid of arg-1%::reason} to uncolored {_reason}
                        set {ban::%uuid of arg-1%::time} to "FOREVER"
                        if {ban::%uuid of arg-1%} is set:
                            message "&cPrevious punishment for %arg-1% &cremoved."
                        add "&r&3Type: &fBAN &3Staff: &r%{_executor}% &3Issued: &r%{ban::%uuid of arg-1%::date}%%nl%&r&3Length: &f%{ban::%uuid of arg-1%::time}%%nl%&r&3Reason: &r%{_reason}%" to {punish-history.%uuid of arg-1%::*}
                        if arg 2 contains "-s":
                            message "&7[Silent] &3%{_executor}% &7banned &3%arg-1% &7for &c%{_reason}%&7. [FOREVER]" to all players where [input has permission "server.helper"]
                        else:
                            broadcast "&3%{_executor}% &7banned &3%arg-1% &7for &c%{_reason}%&7. [FOREVER]"
                        set {ban::%uuid of arg-1%} to true
                        kick arg-1 due to "&cYou are banned from DryEvents.minehut.gg.%nl%%nl%&r%{ban::%uuid of arg-1%::reason}%%nl%%nl%&7&nThis ban will never expire."
                else:
                    message "&c%arg-1% &chas never joined before."
command /unban [<offline player>] [<text>]:
    aliases: uban, ub
    trigger:
        if executor has permission "server.mod":
            if arg 1 is not set:
                message "&7Usage: &3/unban &c<player>"
            else:
                loop all offline players where [input is arg 1]:
                    set {_found} to true
                if {_found} is set:
                    set {_executor} to player 
                    if executor is not a player:
                        set {_executor} to colored "&cConsole"
                    if {ban::%uuid of arg-1%} is set:
                        delete {ban::%uuid of arg-1%}
                        add "&r&3Type: &fUNBAN &3Staff: &r%{_executor}% &3Issued: &r%now%" to {punish-history.%uuid of arg-1%::*}
                        if "%arg-2%" is "-s":
                            message "&7[Silent] &3%player% &7unbanned &c%arg-1%&7." to all players where [input has permission "server.helper"]
                        else:
                            broadcast "&3%player% &7unbanned &c%arg-1%&7."
                    else:
                        message "&c%arg-1% &cis not banned."
                else:
                    message "&c%arg-1% &chas never joined before."


command /punishments [<offline player>] [<text>]:
    aliases: puns, history
    trigger:
        if executor has permission "server.helper":
            if arg 1 is not set:
                message "&7Usage: &3/punishments &c<player>"
            else:
                loop all offline players where [input is arg 1]:
                    set {_found} to true
                if {_found} is set:
                    if size of {punish-history.%uuid of arg-1%::*} is 0:
                        message "&b%arg-1% &bhas no previous punishments."
                    else:
                        message "&3&m------------------------------------------"
                        loop {punish-history.%uuid of arg-1%::*}:
                            message colored loop-value
                        message "&3&m------------------------------------------"    
                else:
                    message "&c%arg-1% &chas never played before."
on connect:
    if {ban::%uuid of player%} is set:
        if {ban::%uuid of player%::time} is not "FOREVER":
            if difference between now and {ban::%uuid of player%::date} < {ban::%uuid of player%::time}:
                set {_dif} to difference between {ban::%uuid of player%::date} and now 
                set {_dif2} to difference between {_dif} and {ban::%uuid of player%::time}
                kick player due to "&cYou are banned from DryEvents.minehut.gg.%nl%%nl%&r%{ban::%uuid of player%::reason}%%nl%%nl%&7&nThis ban will expire in %{_dif2}%&7&n."
            else:
                delete {ban::%uuid of player%}
        else:
            kick player due to "&cYou are banned from DryEvents.minehut.gg.%nl%%nl%&r%{ban::%uuid of player%::reason}%%nl%%nl%&7&nThis ban will never expire."


# Punish


command /tempmute [<offline player>] [<string>] [<text>]:
    aliases: tm, tmute 
    trigger:
        if executor has permission "server.helper":
            if arg 3 is not set:
                message "&7Usage: &3/tempmute &c<player> <duration> [-s] <reason>"
            else:
                set {_time} to arg 2
                if {_time} contains "s":
                    replace all "s" with " seconds" in {_time}
                else if {_time} contains "m":
                    replace all "m" with " minutes" in {_time}
                else if {_time} contains "h":
                    replace all "h" with " hours" in {_time}
                else if {_time} contains "d":
                    replace all "d" with " days" in {_time}
                set {_time2} to "%{_time}%" parsed as timespan
                replace all "second" with "SECOND" in {_time}
                replace all "seconds" with "SECONDS" in {_time}
                replace all "minute" with "MINUTE" in {_time}
                replace all "minutes" with "MINUTES" in {_time}
                replace all "hour" with "HOUR" in {_time}
                replace all "hours" with "HOURS" in {_time}
                replace all "day" with "DAY" in {_time}
                replace all "days" with "DAYS" in {_time}
                if {_time2} is not a timespan:
                    message "&cInput a valid duration."
                else:
                    loop all offline players where [input is arg 1]:
                        set {_found} to true
                    if {_found} is set:
                        set {_reason} to arg 3 
                        replace all "-s " with "" in {_reason}
                        replace all " -s" with "" in {_reason}
                        replace all "-s" with "" in {_reason}
                        if length of {_reason} is 0:
                            message "&7Usage: &3/tempmute &c<player> <duration> [-s] <reason>"
                        else:
                            set {_executor} to "%player%"
                            if executor is not a player:
                                set {_executor} to colored "&cConsole"
                            set {mute::%uuid of arg-1%::date} to now
                            set {mute::%uuid of arg-1%::reason} to uncolored {_reason}
                            set {mute::%uuid of arg-1%::time} to ("%{_time2}%" parsed as timespan)
                            if {mute::%uuid of arg-1%} is set:
                                message "&cPrevious punishment for %arg-1% &cremoved."
                            set {_reason} to arg 3
                            replace all " -s" with "" in {_reason}
                            replace all "-s " with "" in {_reason}
                            replace all "-s" with "" in {_reason}
                            add "&r&3Type: &fmute &3Staff: &r%{_executor}% &3Issued: &r%{mute::%uuid of arg-1%::date}%%nl%&r&3Length: &f%{mute::%uuid of arg-1%::time}%%nl%&r&3Reason: &r%{_reason}%" to {punish-history.%uuid of arg-1%::*}
                            if arg 3 contains "-s":
                                message "&7[Silent] &3%{_executor}% &7muted &3%arg-1% &7for &c%{_reason}%&7. [%{_time}%&7]" to all players where [input has permission "server.helper"]
                            else:
                                broadcast "&3%{_executor}% &7muted &3%arg-1% &7for &c%{_reason}%&7. [%{_time}%&7]"
                            set {mute::%uuid of arg-1%} to true
                            wait 1 tick 
                    else:
                        message "&c%arg-1% &chas never joined before."


command /mute [<offline player>] [<text>]:
    aliases: m 
    trigger:
        if executor has permission "server.helper":
            if arg 2 is not set:
                message "&7Usage: &3/mute &c<player> [-s] <reason>"
            else:
                loop all offline players where [input is arg 1]:
                    set {_found} to true
                if {_found} is set:
                    set {_reason} to arg 2
                    replace all "-s " with "" in {_reason}
                    replace all " -s" with "" in {_reason}
                    replace all "-s" with "" in {_reason}
                    if length of {_reason} is 0:
                        message "&7Usage: &3/mute &c<player> <duration> [-s] <reason>"
                    else:
                        set {_executor} to "%player%"
                        if executor is not a player:
                            set {_executor} to colored "&cConsole"
                        set {mute::%uuid of arg-1%::date} to now
                        set {mute::%uuid of arg-1%::reason} to uncolored {_reason}
                        set {mute::%uuid of arg-1%::time} to "FOREVER"
                        if {mute::%uuid of arg-1%} is set:
                            message "&cPrevious punishment for %arg-1% &cremoved."
                        add "&r&3Type: &fmute &3Staff: &r%{_executor}% &3Issued: &r%{mute::%uuid of arg-1%::date}%%nl%&r&3Length: &f%{mute::%uuid of arg-1%::time}%%nl%&r&3Reason: &r%{_reason}%" to {punish-history.%uuid of arg-1%::*}
                        if arg 2 contains "-s":
                            message "&7[Silent] &3%{_executor}% &7muted &3%arg-1% &7for &c%{_reason}%&7. [FOREVER]" to all players where [input has permission "server.helper"]
                        else:
                            broadcast "&3%{_executor}% &7muted &3%arg-1% &7for &c%{_reason}%&7. [FOREVER]"
                        set {mute::%uuid of arg-1%} to true
                else:
                    message "&c%arg-1% &chas never joined before."


command /warn [<offline player>] [<text>]:
    aliases: m 
    trigger:
        if executor has permission "server.helper":
            if arg 2 is not set:
                message "&7Usage: &3/warn &c<player> [-s] <reason>"
            else:
                loop all offline players where [input is arg 1]:
                    set {_found} to true
                if {_found} is set:
                    set {_reason} to arg 2
                    replace all "-s " with "" in {_reason}
                    replace all " -s" with "" in {_reason}
                    replace all "-s" with "" in {_reason}
                    if length of {_reason} is 0:
                        message "&7Usage: &3/warn &c<player> <duration> [-s] <reason>"
                    else:
                        set {_executor} to "%player%"
                        if executor is not a player:
                            set {_executor} to colored "&cConsole"
                        set {warn::%uuid of arg-1%::date} to now
                        set {warn::%uuid of arg-1%::reason} to uncolored {_reason}
                        if {warn::%uuid of arg-1%} is set:
                            message "&cPrevious punishment for %arg-1% &cremoved."
                        add "&r&3Type: &fWARN &3Staff: &r%{_executor}% &3Issued: &r%{warn::%uuid of arg-1%::date}%%nl%&r&3Reason: &r%{_reason}%" to {punish-history.%uuid of arg-1%::*}
                        if arg 2 contains "-s":
                            message "&7[Silent] &3%{_executor}% &7warned &3%arg-1% &7for &c%{_reason}%&7." to all players where [input has permission "server.helper"]
                        else:
                            broadcast "&3%{_executor}% &7warned &3%arg-1% &7for &c%{_reason}%&7."
                else:
                    message "&c%arg-1% &chas never joined before."
command /unmute [<offline player>] [<text>]:
    aliases: umute, ub
    trigger:
        if executor has permission "server.helper":
            if arg 1 is not set:
                message "&7Usage: &3/unmute &c<player>"
            else:
                loop all offline players where [input is arg 1]:
                    set {_found} to true
                if {_found} is set:
                    set {_executor} to player 
                    if executor is not a player:
                        set {_executor} to colored "&cConsole"
                    if {mute::%uuid of arg-1%} is set:
                        delete {mute::%uuid of arg-1%}
                        add "&r&3Type: &fUNmute &3Staff: &r%{_executor}% &3Issued: &r%now%" to {punish-history.%uuid of arg-1%::*}
                        if "%arg-2%" is "-s":
                            message "&7[Silent] &3%player% &7unmuted &c%arg-1%&7." to all players where [input has permission "server.helper"]
                        else:
                            broadcast "&3%player% &7unmuted &c%arg-1%&7."
                    else:
                        message "&c%arg-1% &cis not muted."
                else:
                    message "&c%arg-1% &chas never joined before."


on chat:
    if {mute::%uuid of player%} is set:
        if {mute::%uuid of player%::time} is not "FOREVER":
            if difference between now and {mute::%uuid of player%::date} < {mute::%uuid of player%::time}:
                set {_dif} to difference between {mute::%uuid of player%::date} and now 
                set {_dif2} to difference between {_dif} and {mute::%uuid of player%::time}
                cancel event
                send "&cYou are muted from DryEvents.minehut.gg.%nl%%nl%&r%{mute::%uuid of player%::reason}%%nl%%nl%&7&nThis mute will expire in %{_dif2}%&7&n."
            else:
                delete {mute::%uuid of player%}
        else:
            send "&cYou are muted from DryEvents.minehut.gg.%nl%%nl%&r%{mute::%uuid of player%::reason}%%nl%%nl%&7&nThis mute will never expire."



command /roll:
    permission: op
    trigger:
        loop all players:
            add loop-player to {_players::*}
        set {_size} to size of {_players::*}
        set {_x} to a random integer between 1 and {_size}
        broadcast "&8[&d&lROLL&8] &dRolling a random player...."
        wait 3 seconds
        broadcast "&8[&d&lROLL&8] &5%{_players::%{_x}%}%&d has been selected!"

command /reroll:
    permission: op
    trigger:
        loop all players:
            add loop-player to {_players::*}
        set {_size} to size of {_players::*}
        set {_x} to a random integer between 1 and {_size}
        broadcast "&8[&d&lREROLL&8] &dRerolling a random player...."
        wait 3 seconds
        broadcast "&8[&d&lROLL&8] &5%{_players::%{_x}%}%&d has been selected!"



You might want to replace DryEvents with your server name.

Edited by SkripterMan
  • Like 3

SkripterMan

Joined Minehut on 4/21/16
Owner of CareSMP.minehut.gg


VIP - 6/21/17
LEGEND - 18/12/20


Discord: SkripterMan#0001
 

Link to post
Share on other sites
  • SkripterMan changed the title to Minehut Punishment Replica Skript

Nice! 🙂

Hello there! If you're reading this, hope you're having a wonderful day!

 

Feel free to contact me via Discord (CoolProgrammer#1920) for any help.

My DMs are always open for help.

You can also message via. forum messages for help.

1604908226_ScreenShot2021-01-28at10_32_28AM.png.2646ad6be239a9d0756a99e8e15602ab.png

Also, don't hesitate to leave a like on my post if I helped you in any way.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...