Jump to content

Warn / Unwarn


Wolfeee_

Recommended Posts

I created an Warning / Unwarning skript. It may work, I don't know. Haven't tested it yet. You may edit if you would like. You don't need to give me credit!
 

command /warn [<player>] [<text>]:
	permission: warn.use
	permission message: &cYou do not have the correct permission to execute this command!
	trigger:
		if arg-1 is set:
			if arg-2 is set:
				broadcast ""
				broadcast "&b&lWarning"
				broadcast "&b%arg-1% &7has been warned by &b%player% &7for &b%arg-2% &7[&b{_warning.%arg-1%}&7]"
				broadcast ""
				add 1 to {_warning.%arg-1%}
				
command /unwarn [<player>]:
	permission: warn.use
	permission message: &cYou do not have the correct permission to execute this command!
	trigger:
		if arg-1 isn't set:
			send "&cUsage: /unwarn <player>"
		if arg-1 is set:
			broadcast ""
			broadcast "&b&lWarning"
			broadcast "&b%arg-1% &7has been un-warned by &b%player%&7!
			broadcast ""
			remove 1 from {_warning.%arg-1%}
			
every 1 tick:
	if {_warning.%arg-1%} is 5:
		execute command "tempban %player% 1hour &bYou have had too many warnings! (5)"
		set {_warning.%arg-1%} to 0

 

  • Like 1

IGN: Wolfeee_
Discord: Nathan.#4380


00243044b4b99f59989b7171466e765c.png

a.png

Link to comment
Share on other sites

Things I would like to point out.

You shouldn't use local variables to save a player's score because it will delete itself after you use some sort of event. Try to use {var::%arg%}. You should also use %arg's uuid% instead of %arg% if the player change their name.

every 1 tick:
	if {_warning.%arg-1%} is 5:
		execute command "tempban %player% 1hour &bYou have had too many warnings! (5)"
		set {_warning.%arg-1%} to 0

This won't work because every 1 tick doesn't have no Idea what's it's executing (Like %arg-1% or %player%).

I think you suppose to add (add 1 warn to player) before the broadcast.

[&b{_warning.%arg-1%}&7]

You forgot to add % before and after {_warning.%arg-1%}

I changed a few things in the warn skript. You can take a look for yourself!

command /warn [<player>] [<text>]:
    permission: warn.use
    permission message: &cYou do not have the correct permission to execute this command!
    trigger:
        if arg-1 is set:
            add 1 to {warning::%arg-1's uuid%}
            broadcast ""
            broadcast "&b&lWarning"
            if arg-2 is set:
                broadcast "&b%arg-1% &7has been warned by &b%player% &7for &b%arg-2% &7[&b%{warning::%arg-1's uuid%}%&7]"
            else:
                broadcast "&b%arg-1% &7has been warned by &b%player% &7[&b%{warning::%arg-1's uuid%}%&7]"
            broadcast ""
            if {warning::%arg-1's uuid%} is 5:
                set {warning::%arg-1's uuid%} to 0
                execute command "tempban %arg-1% 1hour &bYou have had too many warnings! (5)"
        else:
            send "&cUsage: /warn <player> <reason>"
command /unwarn [<player>]:
    permission: warn.use
    permission message: &cYou do not have the correct permission to execute this command!
    trigger:
        if arg isn't set:
            send "&cUsage: /unwarn <player>"
        else:
            if {warning::%arg's uuid%} > 0:
                remove 1 from {warning::%arg's uuid%}
            broadcast ""
            broadcast "&b&lWarning"
            broadcast "&b%arg% &7has been un-warned by &b%player%&7!"
            broadcast ""

Edited by Dextur
  • Like 1
Link to comment
Share on other sites

  • 2 years later...
  • 1 year later...

Can anyone make the Warn Have A mute on it when doing /unwarn

trigger:
        if arg-1 is set:
            add 1 to {warning::%arg-1's uuid%}
            broadcast ""
            broadcast "&c&lWarning"
            if arg-2 is set:
                broadcast "&c%arg-1% &7has been warned by Dont break the Rules Again 😡 &c%player% &7for &c%arg-2% &7[&c%{warning::%arg-1's uuid%}%&7]"
            else:
                broadcast "&c%arg-1% &7has been warned by Dont break the Rules Again &c%player% &7[&c%{warning::%arg-1's uuid%}%&7]"
            broadcast ""
            if {warning::%arg-1's uuid%} is 5:
                set {warning::%arg-1's uuid%} to 0
                execute command "mute %arg-1% 1m &cYou have had too many warnings! (5)"
        else:
            send "&cUsage: /warn <player> <reason>"
command /unwarn [<player>]:
    permission: warn.use
    permission message: &cYou do not have the correct permission to execute this command!
    trigger:
        if arg isn't set:
            send "&cUsage: /unwarn <player>"
        else:
            if {warning::%arg's uuid%} > 0:
                remove 1 from {warning::%arg's uuid%}
            broadcast ""
            broadcast "&a&lUnWarning"
            broadcast "&a%arg% &7has been un-warned by Sorry for the Accusement bro &a%player%&7!"
            execute command "unmute %arg-1%  &bSorry Dude :("

Link to comment
Share on other sites

Please make sure that you aren't responding to posts that haven't been responded to in over a month. Thanks!

No rank - 2017-2021

Minehut Tester - 2021-2023

Minehut Volunteer Moderator - 2023-Current

Report a player/server: Report Player / Server

Create a support ticket: Submit a request

 

Did I help you? If so, feel free to give me a like!

Link to comment
Share on other sites

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