Mute Command

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Ripdog1

Member
Apr 7, 2017
4
0
0
23
United States
www.youtube.com
I have tried to create a mute command and have tried other people's as well, but nothing seems to be working. Hopefully someone can help me with this.

code_language.skript:
command /mute <player> <text>:
    permission: ON.mute
    permission message: {@PM}
    usage: /mute <player> <reason>
    trigger:
        set {_message} to arg 2
        if arg 1 is not set:
            message "&cYou must specify a player!" to the player
        if arg 2 is not set:
            message "&cYou must add a reason why this player should be muted!" to the player
        if arg 1 is set:
            if arg 2 is set:
                set {mute.%arg 1%} to arg 1
                message "&c%{mute.%arg 1%}% &6has been muted for the reason: &c%{_message}%"
            
command /unmute <player>:
    permission: ON.mute
    permission message: {@PM}
    usage: /unmute <player>
    trigger:
        if arg 1 is not set:
            message "You must specify a player to be unmuted."
        if arg 1 is set:
            set {mute.%arg 1%} to arg 1
            message "&6You have unmuted %arg 1%"
            
on chat:
    if {mute.%arg 1%} is set:
        cancel event
 
code_language.skript:
command /mute [<player] [<text>]:
    permission: permission.mute
    permission message: Fuck off my command.
    trigger:
        if arg-1 is set:
            if arg-1 is online:
                if arg-2 is set:
                    set {mute.%uuid of arg-1%} to true
                    broadcast "&c%player%&b has muted &a%arg-1%&b for &e%arg-2%."
                else if arg-2 isn't set:
                    send "&7&o/mute player reason" to player
            else if arg-1 isn't online:
                send "&7&oThat player does not seem to be online." to player
        else if arg-1 isn't set:
            send "&7&o/mute player reason" to player
            
            
command /unmute [<offlineplayer>]:
    permission: permission.unmute
    permission message: Fuck off my command.
    trigger:
        if arg-1 is set:
            if {mute.%uuid of arg-1%} exists:
                delete {mute.%uuid of arg-1%}
                broadcast "&c%player%&b has unmuted &a%arg-1%&b for &e%arg-2%."
            else:
                send "&6That player has never connected to this server." to player
        else if arg-1 isn't set:
            send "&7&o/unmute player" to player
            
            
on chat:
    if {mute.%uuid of player%} is true:
        cancel event
        send "&aYou are muted therefore you cannot speak." to player
 
  • Like
Reactions: Ripdog1
if you wanna know what did you wrong?

You did at "on chat:" if variables is set with "%arg-1%" ... there is no commands. you need put with "%player%" :emoji_grinning:
 
  • Like
Reactions: Ripdog1
code_language.skript:
command /mute [<player] [<text>]:
    permission: permission.mute
    permission message: Fuck off my command.
    trigger:
        if arg-1 is set:
            if arg-1 is online:
                if arg-2 is set:
                    set {mute.%uuid of arg-1%} to true
                    broadcast "&c%player%&b has muted &a%arg-1%&b for &e%arg-2%."
                else if arg-2 isn't set:
                    send "&7&o/mute player reason" to player
            else if arg-1 isn't online:
                send "&7&oThat player does not seem to be online." to player
        else if arg-1 isn't set:
            send "&7&o/mute player reason" to player
           
           
command /unmute [<offlineplayer>]:
    permission: permission.unmute
    permission message: Fuck off my command.
    trigger:
        if arg-1 is set:
            if {mute.%uuid of arg-1%} exists:
                delete {mute.%uuid of arg-1%}
                broadcast "&c%player%&b has unmuted &a%arg-1%&b for &e%arg-2%."
            else:
                send "&6That player has never connected to this server." to player
        else if arg-1 isn't set:
            send "&7&o/unmute player" to player
           
           
on chat:
    if {mute.%uuid of player%} is true:
        cancel event
        send "&aYou are muted therefore you cannot speak." to player

if you wanna know what did you wrong?

You did at "on chat:" if variables is set with "%arg-1%" ... there is no commands. you need put with "%player%" :emoji_grinning:

Thank you guys so much for helping!