1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mute Command

Discussion in 'Requests' started by Ripdog1, Jul 9, 2017.

  1. Ripdog1

    Ripdog1 Member

    Joined:
    Apr 7, 2017
    Messages:
    4
    Likes Received:
    0
    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 (Skript):
    1. command /mute <player> <text>:
    2.     permission: ON.mute
    3.     permission message: {@PM}
    4.     usage: /mute <player> <reason>
    5.     trigger:
    6.         set {_message} to arg 2
    7.         if arg 1 is not set:
    8.             message "&cYou must specify a player!" to the player
    9.         if arg 2 is not set:
    10.             message "&cYou must add a reason why this player should be muted!" to the player
    11.         if arg 1 is set:
    12.             if arg 2 is set:
    13.                 set {mute.%arg 1%} to arg 1
    14.                 message "&c%{mute.%arg 1%}% &6has been muted for the reason: &c%{_message}%"
    15.            
    16. command /unmute <player>:
    17.     permission: ON.mute
    18.     permission message: {@PM}
    19.     usage: /unmute <player>
    20.     trigger:
    21.         if arg 1 is not set:
    22.             message "You must specify a player to be unmuted."
    23.         if arg 1 is set:
    24.             set {mute.%arg 1%} to arg 1
    25.             message "&6You have unmuted %arg 1%"
    26.            
    27. on chat:
    28.     if {mute.%arg 1%} is set:
    29.         cancel event
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. command /mute [<player] [<text>]:
    2.     permission: permission.mute
    3.     permission message: Fuck off my command.
    4.     trigger:
    5.         if arg-1 is set:
    6.             if arg-1 is online:
    7.                 if arg-2 is set:
    8.                     set {mute.%uuid of arg-1%} to true
    9.                     broadcast "&c%player%&b has muted &a%arg-1%&b for &e%arg-2%."
    10.                 else if arg-2 isn't set:
    11.                     send "&7&o/mute player reason" to player
    12.             else if arg-1 isn't online:
    13.                 send "&7&oThat player does not seem to be online." to player
    14.         else if arg-1 isn't set:
    15.             send "&7&o/mute player reason" to player
    16.            
    17.            
    18. command /unmute [<offlineplayer>]:
    19.     permission: permission.unmute
    20.     permission message: Fuck off my command.
    21.     trigger:
    22.         if arg-1 is set:
    23.             if {mute.%uuid of arg-1%} exists:
    24.                 delete {mute.%uuid of arg-1%}
    25.                 broadcast "&c%player%&b has unmuted &a%arg-1%&b for &e%arg-2%."
    26.             else:
    27.                 send "&6That player has never connected to this server." to player
    28.         else if arg-1 isn't set:
    29.             send "&7&o/unmute player" to player
    30.            
    31.            
    32. on chat:
    33.     if {mute.%uuid of player%} is true:
    34.         cancel event
    35.         send "&aYou are muted therefore you cannot speak." to player
     
    Ripdog1 likes this.
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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:
     
    Ripdog1 likes this.
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Thank you guys so much for helping!
     

Share This Page

Loading...