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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Can't mute / don't know about temp timers

Discussion in 'Skript' started by Adrenaline, May 17, 2020.

Thread Status:
Not open for further replies.
  1. Adrenaline

    Adrenaline Member

    Joined:
    May 17, 2020
    Messages:
    2
    Likes Received:
    0
    I'm writing a bunch of scripts for my server, and most of them have been working with just a little bit of time. I've made a script for muting players for my BIG script project. When I type /mute <player> <reason> it does everything it should, message wise. But when a muted player tries to speak, they can still speak. And before making changes, it would mute the whole chat with the variable {trypvp.muted.%player%}. Does anyone know how to fix this?

    Code (Text):
    1. command /mute [<offline player>] [<text>]:
    2.     permission: trypvp.mute
    3.     permission message: &4Permission>&9 You do not have permission!
    4.     trigger:
    5.         if arg 2 is not set:
    6.             send "&4Usage>&9 Command Usage: &c/mute <player> <reason> &4Admin"
    7.         if arg 2 is set:
    8.             set {reason} to arg 2
    9.             set {punished} to arg 1
    10.             set {player} to player
    11.             set {muted_type} to "perm"
    12.             set {trypvp::muted::%arg-1%} to "true"
    13.             send "&4Punish>&9 You muted &c%{punished}% because &e%{reason}%"
    14.             send "&4Punish>&9 You can't talk because you're muted by %{player}% because %{reason}%" to arg 1
    15.             send "&4Punish> &9&lMute Reason: %{Reason}%" to arg 1
    16.             send "&4Punish>&9 Believe this was false? Appeal at trypvp.enjin.com" to arg 1
    17.             loop all players:
    18.                 if loop-player has permission "trypvp.punishments":
    19.                     send "&4Punish>&9 %{player}% has issued a mute on %{punished}% because %{reason}%" to loop-player
    20.                        
    21. on chat:
    22.     if {trypvp::muted::%arg-1%} is "true":
    23.         if {muted_type} is "perm":
    24.             send "&4Punish> &9You can't talk because you're muted by &c%{player}% &9because &e%{reason}% for &ePermanent" to {punished}
    25.             cancel event
    26.             stop
    27.         if {muted_type} is "temp":
    28.             set {waited} to difference between now and {trypvp::%arg-1%::muted::when}
    29.             if {waited} is less than {trypvp::%arg-1%::muted::time}:
    30.                 send "&4Punish> &9You can't talk because you're muted by &c%{player}% because &e%{reason}% for &ePermanent" to {punished}
    31.                 cancel event
    32.                 stop
    33.                
    34. command /tempmute [<offline player>] [<text>] [<text>]:
    35.     permission: trypvp.tempmute
    36.     permission message: &4Permission>&9 You do not have permission!
    37.     trigger:
    38.         if arg 3 is not set:
    39.             send "&4Usage>&9 Command Usage:&c /tempmute <player> <time:minute/hour/day> <reason> &4Admin"
    40.         if arg 3 is set:
    41.             set {reason} to arg 3
    42.             set {punished} to arg 1
    43.             set {player} to player
    44.             set {muted_type} to "temp"
    45.             set {trypvp::%player%::muted::when} to time
    46.             set {trypvp::%player%::muted::time} to arg 2
    47.             set {trypvp::muted::%arg-1%} to "true"
    48.             send "&4Punish>&9 You muted %{punished}% because %{reason}% for &e%{trypvp.%player%.muted::time}%" to player
    49.             send "&4Punish>&9 You can't talk because you're muted by %{player}% because %{reason}%" to arg 1
    50.             send "&4Punish> &9&lMute Reason: %{reason}%" to arg 1
    51.             send "&4Punish> &9&lMute Duration: %{trypvp::%player%::muted::time}%" to arg 1
    52.             send "&4Punish>&9 Believe this was false? Appeal at trypvp.enjin.com" to arg 1
    53.             loop all players:
    54.                 if loop-player has permission "trypvp.punishments":
    55.                     send "&4Punish>&9 %{player}% has issued a mute on %{punished}% because %{reason}% for &e%{trypvp.%player%.muted::time}%" to loop-player
    56. command /unmute [<offline player>] [<text>]:
    57.     permission: trypvp.unmute
    58.     permission message: &4Permission>&9 You do not have permission!
    59.     trigger:
    60.         if arg 2 is not set:
    61.             send "&4Usage>&9 Command Usage:&c /unmute <player> <reason> &bQuality Assurance"
    62.         if arg 2 is set:
    63.             set {trypvp::muted::%arg-1%} to "false"
    64.             set {player} to player
    65.             set {reason} to arg 2
    66.             set {punished} to arg 1
    67.             send "&4Punish>&9 You unmuted %{punished}% because %{reason}%" to player
    68.             send "&4Punish>&9 You have been unmuted by &c%{player}%&9 because&e %{reason}%" to {punished}
    69.             loop all players:
    70.                 if loop-player has permission "trypvp.punishments":
    71.                     send "&4Punish>&9 %{player}% has unmuted &e%{punished}%&9 because &e%{reason}%"
    I would also like to know how to get a countdown timer for /tempmute.

    Also, I want to know how to set chat prefixes and formats, such as "Owner Adrenaline message" but that's not my first priority.

    Thanks!
     
  2. Flowy

    Flowy New Member

    Joined:
    May 29, 2020
    Messages:
    6
    Likes Received:
    0
    Code (Text):
    1. command /mute [<offline player>] [<text>]:
    2.     permission: trypvp.mute
    3.     permission message: &4Permission>&9 You do not have permission!
    4.     trigger:
    5.         if arg 2 is not set:
    6.             send "&4Usage>&9 Command Usage: &c/mute <player> <reason> &4Admin"
    7.         if arg 2 is set:
    8.             set {reason::%arg-1%} to arg 2
    9.             set {punished::%arg-1%} to arg 1
    10.             set {player::%player%} to player
    11.             set {muted_type::%arg-1%} to "perm"
    12.             set {trypvp::muted::%arg-1%} to true
    13.             send "&4Punish>&9 You muted &c%{punished::%arg-1%}% because &e%{reason::%arg-1%}%"
    14.             send "&4Punish>&9 You can't talk because you're muted by %player% because %{reason::%arg-1%}%" to arg 1
    15.             send "&4Punish> &9&lMute Reason: %{Reason::%arg-1%}%" to arg 1
    16.             send "&4Punish>&9 Believe this was false? Appeal at trypvp.enjin.com" to arg 1
    17.             loop all players:
    18.                 if loop-player has permission "trypvp.punishments":
    19.                     send "&4Punish>&9 %player% has issued a mute on %{punished::%arg-1%}% because %{reason::%arg-1%}%" to loop-player                    
    20. on chat:
    21.     if {trypvp::muted::%player%} is true:
    22.         if {muted_type::%player%} is "perm":
    23.             send "&4Punish> &9You can't talk because you're muted by &c%{player}% &9because &e%{reason}% for &ePermanent" to player
    24.             cancel event
    25.             stop
    26. on chat:
    27.     if {uaremuted::%player%} is true:
    28.         send "&4Punish> &cYou can't talk because you're muted by &3&l%{punisher::%player%}% &cbecause &3&l%{mutereason::%player%}% &cfor &3&l%{timetype::%player%}% %{timetype2::%player%}%" to player
    29.         cancel event
    30.         stop      
    31. command /tempmute [<offline player>] [<text>] [<text>] [<text>]:
    32.     permission: trypvp.tempmute
    33.     permission message: &4Permission>&9 You do not have permission!
    34.     trigger:
    35.         if arg 4 is not set:
    36.             send "&4Usage>&9 Command Usage:&c /tempmute <player> <time> <minute/hour/day> <reason> &4Admin"
    37.         if arg 4 is set:
    38.             broadcast "&4Punish> &c%arg-1% &3muted by &c%player%&3."
    39.             broadcast "&4Punish> Mute Reason: &c%arg-4%"
    40.             broadcast "&4Punish> Mute Duration: &c%arg-2% %arg-3%."
    41.             send "&4Punish> &cYou are muted by &3%player%. &cYou can't speak from now on" to arg-1
    42.             send "&4Punish> &aPlayer successfully muted."
    43.             set {timetype::%arg-1%} to arg-2
    44.             set {timetype2::%arg-1%} to arg-3
    45.             set {mutereason::%arg-1%} to arg-4
    46.             set {punisher::%arg-1%} to player
    47.             set {uaremuted::%arg-1%} to true
    48.             if arg-3 is "second" or "seconds":
    49.                 wait "%{timetype::%arg-1%}% seconds" parsed as timespan
    50.                 set {uaremuted::%arg-1%} to false
    51.             else if arg-3 is "minute" or "minutes":
    52.                 wait "%{timetype::%arg-1%}% minutes" parsed as timespan
    53.                 set {uaremuted::%arg-1%} to false
    54.             else if arg-3 is "hour" or "hours":
    55.                 wait "%{timetype::%arg-1%}% hours" parsed as timespan
    56.                 set {uaremuted::%arg-1%} to false
    57.             else if arg-3 is "day" or "days":
    58.                 wait "%{timetype::%arg-1%}% days" parsed as timespan
    59.                 set {uaremuted::%arg-1%} to false      
    60. command /unmute [<offline player>] [<text>]:
    61.     permission: trypvp.unmute
    62.     permission message: &4Permission>&9 You do not have permission!
    63.     trigger:
    64.         if arg 2 is not set:
    65.             send "&4Usage>&9 Command Usage:&c /unmute <player> <reason> &bQuality Assurance"
    66.         if arg 2 is set:
    67.             set {trypvp::muted::%arg-1%} to "false"
    68.             set {player} to player
    69.             set {reason::%arg-1%} to arg 2
    70.             set {uaremuted::%player%} to false
    71.             set {punished::%arg-1%} to arg 1
    72.             send "&4Punish>&9 You unmuted %{punished::%arg-1%}% because %{reason::%arg-1%}%" to player
    73.             send "&4Punish>&9 You have been unmuted by &c%player%&9 because&e %{reason::%arg-1%}%" to arg-1
    74.             loop all players:
    75.                 if loop-player has permission "trypvp.punishments":
    76.                     if loop-player is player:
    77.                         stop
    78.                     else:
    79.                         send "&4Punish>&9 %player% has unmuted &e%{punished::%arg-1%}%&9 because &e%{reason::%arg-1%}%"
    Temporary mute is all different. I rewrote it from the beginning (but system is same, just little bit different)
    If you read 1-2 times, you will understand what is different.
    If you don't understand something, you can ask me.

    Even so, it is better to use plugins in such classic systems. :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...