Jump to content

MinehutRanks | Skript


ImANoobFightMeh

Recommended Posts

Want to have a rank system like minehut? Here you go!

 

Variables:
    {playerrank.%player%}  = "default"

command /rank [<offlineplayer>] [<text>]:
    trigger:
        if player is op:
            if arg-1 is set:
                if arg-2 is set:
                    if arg-1 is "default":
                        set {playerrank.%arg-1%} to "default"
                        send "&3You have set &b%player%&b's &3rank to &bDefault"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "vip":
                        send "&3You have set &b%player%&b's &3rank to &bVIP"
                        set {playerrank.%arg-1%} to "vip"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "pro":
                        send "&3You have set &b%player%&b's &3rank to &bPRO"
                        set {playerrank.%arg-1%} to "pro"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "legend":
                        send "&3You have set &b%player%&b's &3rank to &bLEGEND"
                        set {playerrank.%arg-1%} to "legend"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "patron":
                        send "&3You have set &b%player%&b's &3rank to &bPATRON"
                        set {playerrank.%arg-1%} to "patron"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "jrmod":
                        send "&3You have set &b%player%&b's &3rank to &bJR.MOD"
                        set {playerrank.%arg-1%} to "jrmod"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "mod":
                        send "&3You have set &b%player%&b's &3rank to &bMOD"
                        set {playerrank.%arg-1%} to "jrmod"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "srmod":
                        send "&3You have set &b%player%&b's &3rank to &bSR.MOD"
                        set {playerrank.%arg-1%} to "srmod"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "admin":
                        send "&3You have set &b%player%&b's &3rank to &bADMIN"
                        set {playerrank.%arg-1%} to "admin"
                        make console execute the command "/sudo %arg-1% tablist"
                else:
                    send "&c/rank (player) (rank)"
            else:
                send "&c/rank (player) (rank)"
        else:
            send "&cInsufficient permissions!"

on chat:
    if {playerrank.%player%} = "default":
        set the chat format to "&7%player%&7: &7%message%"
    if {playerrank.%player%} = "vip":
        set the chat format to "&a[VIP] &a%player%&f: &7%message%"
    if {playerrank.%player%} = "pro":
        set the chat format to "&b[PRO] &b%player%&f: &7%message%"
    if {playerrank.%player%} = "legend":
        set the chat format to "&6[LEGEND] &6%player%&f: &7%message%"
    if {playerrank.%player%} = "patron":
        set the chat format to "&3[PATRON] &3%player%&f: &7%message%"
    if {playerrank.%player%} = "jrmod":
        set the chat format to "&e[JR.MOD] &e%player%&f: &7%message%"
    if {playerrank.%player%} = "mod":
        set the chat format to "&e[MOD] &e%player%&f: &7%message%"
    if {playerrank.%player%} = "srmod":
        set the chat format to "&e[SR.MOD] &e%player%&f: &7%message%"
    if {playerrank.%player%} = "admin":
        set the chat format to "&c[ADMIN]&c %player%&f: &7%message%"

command /tablist:
    trigger:
        if {playerrank.%player%} = "default":
            set player's tablist name to "&7%player%"
        if {playerrank.%player%} = "vip":
            set player's tablist name to "&a[VIP] &a%player%"
        if {playerrank.%player%} = "pro":
            set player's tablist name to "&b[PRO] &b%player%"
        if {playerrank.%player%} = "legend":
            set player's tablist name to "&6[LEGEND] &6%player%"
        if {playerrank.%player%} = "patron":
            set player's tablist name to "&3[PATRON] &3%player%"
        if {playerrank.%player%} = "jrmod":
            set player's tablist name to "&e[JR.MOD] &e%player%"
        if {playerrank.%player%} = "mod":
            set player's tablist name to "&e[MOD] &e%player%"
        if {playerrank.%player%} = "srmod":
            set player's tablist name to "&e[SR.MOD] &e%player%"
        if {playerrank.%player%} = "admin":
            set player's tablist name to "&c[ADMIN] &c%player%"

Link to comment
Share on other sites

Nice, there could be a few improvements but at least it gets the job done 👍


-------------------------------------------------------------
[VIP] - 2018/2019

[JR.MOD] - 28th April 2019
[SR.MOD] - 21st June 2019

[LEGEND] - 28th July 2020 (Resigned)

-------------------------------------------------------------

Discord - Criticyl#0002

IGN - Criticyl

Link to comment
Share on other sites

Seems a bit long for no reason, you could shorten it by using functions.

Ex:

function setRank(p: offlineplayer, r: text):

    set {_uuid} to uuid of {_p}

    set {rank::%{_uuid}%} to {_r}

 

You could also use a list variable to check if it is a rank you want to be able to get set, and see if that list contains the argument.

[VIP] 2019

[JR.MOD] 10/29/2019

[MOD] 12/30/2019

nerd3.png

ok.png

sure.png

q.png

Link to comment
Share on other sites

On 10/16/2019 at 5:40 PM, ImANoobFightMeh said:

Want to have a rank system like minehut? Here you go!

 

Variables:
    {playerrank.%player%}  = "default"

command /rank [<offlineplayer>] [<text>]:
    trigger:
        if player is op:
            if arg-1 is set:
                if arg-2 is set:
                    if arg-1 is "default":
                        set {playerrank.%arg-1%} to "default"
                        send "&3You have set &b%player%&b's &3rank to &bDefault"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "vip":
                        send "&3You have set &b%player%&b's &3rank to &bVIP"
                        set {playerrank.%arg-1%} to "vip"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "pro":
                        send "&3You have set &b%player%&b's &3rank to &bPRO"
                        set {playerrank.%arg-1%} to "pro"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "legend":
                        send "&3You have set &b%player%&b's &3rank to &bLEGEND"
                        set {playerrank.%arg-1%} to "legend"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "patron":
                        send "&3You have set &b%player%&b's &3rank to &bPATRON"
                        set {playerrank.%arg-1%} to "patron"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "jrmod":
                        send "&3You have set &b%player%&b's &3rank to &bJR.MOD"
                        set {playerrank.%arg-1%} to "jrmod"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "mod":
                        send "&3You have set &b%player%&b's &3rank to &bMOD"
                        set {playerrank.%arg-1%} to "jrmod"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "srmod":
                        send "&3You have set &b%player%&b's &3rank to &bSR.MOD"
                        set {playerrank.%arg-1%} to "srmod"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "admin":
                        send "&3You have set &b%player%&b's &3rank to &bADMIN"
                        set {playerrank.%arg-1%} to "admin"
                        make console execute the command "/sudo %arg-1% tablist"
                else:
                    send "&c/rank (player) (rank)"
            else:
                send "&c/rank (player) (rank)"
        else:
            send "&cInsufficient permissions!"

on chat:
    if {playerrank.%player%} = "default":
        set the chat format to "&7%player%&7: &7%message%"
    if {playerrank.%player%} = "vip":
        set the chat format to "&a[VIP] &a%player%&f: &7%message%"
    if {playerrank.%player%} = "pro":
        set the chat format to "&b[PRO] &b%player%&f: &7%message%"
    if {playerrank.%player%} = "legend":
        set the chat format to "&6[LEGEND] &6%player%&f: &7%message%"
    if {playerrank.%player%} = "patron":
        set the chat format to "&3[PATRON] &3%player%&f: &7%message%"
    if {playerrank.%player%} = "jrmod":
        set the chat format to "&e[JR.MOD] &e%player%&f: &7%message%"
    if {playerrank.%player%} = "mod":
        set the chat format to "&e[MOD] &e%player%&f: &7%message%"
    if {playerrank.%player%} = "srmod":
        set the chat format to "&e[SR.MOD] &e%player%&f: &7%message%"
    if {playerrank.%player%} = "admin":
        set the chat format to "&c[ADMIN]&c %player%&f: &7%message%"

command /tablist:
    trigger:
        if {playerrank.%player%} = "default":
            set player's tablist name to "&7%player%"
        if {playerrank.%player%} = "vip":
            set player's tablist name to "&a[VIP] &a%player%"
        if {playerrank.%player%} = "pro":
            set player's tablist name to "&b[PRO] &b%player%"
        if {playerrank.%player%} = "legend":
            set player's tablist name to "&6[LEGEND] &6%player%"
        if {playerrank.%player%} = "patron":
            set player's tablist name to "&3[PATRON] &3%player%"
        if {playerrank.%player%} = "jrmod":
            set player's tablist name to "&e[JR.MOD] &e%player%"
        if {playerrank.%player%} = "mod":
            set player's tablist name to "&e[MOD] &e%player%"
        if {playerrank.%player%} = "srmod":
            set player's tablist name to "&e[SR.MOD] &e%player%"
        if {playerrank.%player%} = "admin":
            set player's tablist name to "&c[ADMIN] &c%player%"

Clean code. I have one small suggestion though, I think you should shorten the code. Also maybe make /tablist only excecutable by console? This is the prevent users from being able to perform random commands. To fix this just change the code to:
 

command /tablist:
    executable by: console
    trigger:
        if {playerrank.%player%} = "default":
            set player's tablist name to "&7%player%"
        if {playerrank.%player%} = "vip":
            set player's tablist name to "&a[VIP] &a%player%"
        if {playerrank.%player%} = "pro":
            set player's tablist name to "&b[PRO] &b%player%"
        if {playerrank.%player%} = "legend":
            set player's tablist name to "&6[LEGEND] &6%player%"
        if {playerrank.%player%} = "patron":
            set player's tablist name to "&3[PATRON] &3%player%"
        if {playerrank.%player%} = "jrmod":
            set player's tablist name to "&e[JR.MOD] &e%player%"
        if {playerrank.%player%} = "mod":
            set player's tablist name to "&e[MOD] &e%player%"
        if {playerrank.%player%} = "srmod":
            set player's tablist name to "&e[SR.MOD] &e%player%"
        if {playerrank.%player%} = "admin":
            set player's tablist name to "&c[ADMIN] &c%player%"

 

|Ex Staff|

download.jpg.af28032f9dfcfef569a01b3c5168646e.jpg - Matqx#5545

1045330945_download(1).jpg.42534e5f7de249b44b6e4fb4af0570aa.jpg - Matqx // Pro

 Rules // Discord // Voting Link

Link to comment
Share on other sites

Not big fan of this. 
It would be way more convenient if you'd use this expression:

[the] [chat] (prefix|suffix) of %players% 

This requires vault & a permission plugin, obviously.
You can just set their prefix to the rank.

and you can just use `make player execute "/tablist"`

From there you can just do:

on chat:
	if player's prefix is " ":
		set player's prefix to "&7Default"
	set chat format to "%player's display name&f: %message%"

 

 

On 10/22/2019 at 12:21 PM, Matqx said:

Clean code. I have one small suggestion though, I think you should shorten the code. Also maybe make /tablist only excecutable by console? This is the prevent users from being able to perform random commands. To fix this just change the code to:
 


command /tablist:
    executable by: console
    trigger:
        if {playerrank.%player%} = "default":
            set player's tablist name to "&7%player%"
        if {playerrank.%player%} = "vip":
            set player's tablist name to "&a[VIP] &a%player%"
        if {playerrank.%player%} = "pro":
            set player's tablist name to "&b[PRO] &b%player%"
        if {playerrank.%player%} = "legend":
            set player's tablist name to "&6[LEGEND] &6%player%"
        if {playerrank.%player%} = "patron":
            set player's tablist name to "&3[PATRON] &3%player%"
        if {playerrank.%player%} = "jrmod":
            set player's tablist name to "&e[JR.MOD] &e%player%"
        if {playerrank.%player%} = "mod":
            set player's tablist name to "&e[MOD] &e%player%"
        if {playerrank.%player%} = "srmod":
            set player's tablist name to "&e[SR.MOD] &e%player%"
        if {playerrank.%player%} = "admin":
            set player's tablist name to "&c[ADMIN] &c%player%"

This won't work... His code is "Sudoing" the player, the player will execute the command.

Edited by Creeper1841
The code snippet in the quote was "html"

 

image.png.e46e91961f1d6d4604a6e5f3dcb5a2bd.png

unknown.pngunknown.png

Link to comment
Share on other sites

  • 1 month later...

Nice code but but

 

                    if arg-2 is "jrmod":
                        send "&3You have set &b%player%&b's &3rank to &bJR.MOD"
                        set {playerrank.%arg-1%} to "jrmod"
                        make console execute the command "/sudo %arg-1% tablist"
                    if arg-2 is "mod":
                        send "&3You have set &b%player%&b's &3rank to &bMOD"
                        set {playerrank.%arg-1%} to "jrmod"
                        make console execute the command "/sudo %arg-1% tablist"

lol 2 same ranks

Link to comment
Share on other sites

  • 1 year later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...