Jump to content

Mod Promotion/Demotion [SKRIPT]


iiFlameYT

Recommended Posts

Variables:
    {playerrank.%player%}  = "default"
command /promote [<player>]:
	permission: op
	trigger:
		if arg-1 is not set:
			send "&cSpecify a player..."
		else:
			set {playerrank. %arg-1%} to "mod"
			send "&aYou have been promoted to &eMod" to arg-1
			send "&aYou have Promoted &6%arg-1%" to player

command /demote [<player>] [<text>]:
    permission: op
    trigger:
        if arg-2 is not set:
            send "&cYou have been demoted by &6%player%" to arg-1
            send "&6%arg-1%&a Was successfuly demoted." to player
            if arg-1 is not set:
                send "&cSpecify a player..."
            else:
                set {playerrank. %arg-1%} to "default"
        else:
            set {playerrank. %arg-1%} to "default"
            send "&cYou have been demoted by &6%player% &cfor &7&l%arg-2%" to arg-1
            send "&6%arg-1%&a Was successfuly demoted for &7&l%arg-2%" to player
on chat:
    if {playerrank. %player%} = "Mod":
        set the chat format to "&0[&eMod&0]&f %player%: %message%"
on chat:
    if {playerrank. %player%} = "default":
        set the chat format to "&0[&7Default&0]&f %player%: %message%"

Hey, please thank me on the post 🙂

dw it works perfectly

  • Like 2
  • Thanks 1

 

 

Link to comment
Share on other sites

Nested variables bad

  • Sad 1

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

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

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

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

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Nested variables bad, 2 events when you can else if,

        if arg-2 is not set:
            send "&cYou have been demoted by &6%player%" to arg-1
            send "&6%arg-1%&a Was successfuly demoted." to player
            if arg-1 is not set:
                send "&cSpecify a player..."
            else:
                set {playerrank. %arg-1%} to "default"

When you're checking if arg 2 is not set, arg 1 has to be set. You can remove the arg 1 is not set check. You can also make each argument required.

If I helped you at all, leave a like!

IGN: _omga
Discord: omega#1000

 

Link to comment
Share on other sites

Just now, _omga said:

Nested variables bad, 2 events when you can else if,


        if arg-2 is not set:
            send "&cYou have been demoted by &6%player%" to arg-1
            send "&6%arg-1%&a Was successfuly demoted." to player
            if arg-1 is not set:
                send "&cSpecify a player..."
            else:
                set {playerrank. %arg-1%} to "default"

When you're checking if arg 2 is not set, arg 1 has to be set. You can remove the arg 1 is not set check. You can also make each argument required.

im making it easier

 

 

Link to comment
Share on other sites

1 hour ago, iiFlameYT said:

i found it easier for me

There are times using 2 events can cause issues. Maybe not in this skript but in others it can. It can also help easier for Skript to handle since it only has to register one chat event instead of having 2. 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

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

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

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

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

2 minutes ago, _Tarna_ said:

There are times using 2 events can cause issues. Maybe not in this skript but in others it can. It can also help easier for Skript to handle since it only has to register one chat event instead of having 2. 

i just appealed for unmute

 

 

Link to comment
Share on other sites

12 hours ago, iiFlameYT said:

Variables:
    {playerrank.%player%}  = "default"
command /promote [<player>]:
	permission: op
	trigger:
		if arg-1 is not set:
			send "&cSpecify a player..."
		else:
			set {playerrank. %arg-1%} to "mod"
			send "&aYou have been promoted to &eMod" to arg-1
			send "&aYou have Promoted &6%arg-1%" to player

command /demote [<player>] [<text>]:
    permission: op
    trigger:
        if arg-2 is not set:
            send "&cYou have been demoted by &6%player%" to arg-1
            send "&6%arg-1%&a Was successfuly demoted." to player
            if arg-1 is not set:
                send "&cSpecify a player..."
            else:
                set {playerrank. %arg-1%} to "default"
        else:
            set {playerrank. %arg-1%} to "default"
            send "&cYou have been demoted by &6%player% &cfor &7&l%arg-2%" to arg-1
            send "&6%arg-1%&a Was successfuly demoted for &7&l%arg-2%" to player
on chat:
    if {playerrank. %player%} = "Mod":
        set the chat format to "&0[&eMod&0]&f %player%: %message%"
on chat:
    if {playerrank. %player%} = "default":
        set the chat format to "&0[&7Default&0]&f %player%: %message%"

Hey, please thank me on the post 🙂

dw it works perfectly

Its really but really good im a skripter and i see it very good who say its poop he poop hem self 🙂

  • Thanks 1
Link to comment
Share on other sites

what in the world is going on here

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 comment
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...