Typical Mute System

  • 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!

memduhb

Member
Jul 26, 2017
2
0
0
28
Category: Skript

Suggested name: huh?

What I want:
What I want is, a mute system that mutes with his own brain. I mean when i type /mute <player> <reason> if its his first mute it will be 15m, if its his 2nd mute it will be 30m, if its his 3rd mute it will be 2hours, if its his 4rd mute it will be 1 day, if its his 5th mute it will be 1week.

Ideas for commands:

/mute <player> <reason>


Ideas for permissions:


grpcsystems.*


When I'd like it by: As fast as you can guys do please. Thanks for reading btw.
 
Oh. That's actually pretty clever and avoids having to type the timespan that's bugged as hell while using it on a command.

Here, because I may start using it myself too. Know that i only use [<text>] on commands as i like my own errors messages.

code_language.skript:
command /mute [<text>] [<text>]:
    trigger:
        player doesn't have permission "grpcsystems.*":
            message "&cYou have no permission to do this."
            stop
        arg 1 is not set:
            message "&cCorrect usage: /mute <player> <reason>"
            stop
        "%arg 1%" parsed as offline player hasn't played before:
            message "&eWARNING: %arg 1% hasn't played here before."
        {mutes::%arg 1%} is not set:
            set {mutes::%arg 1%} to 0
        {mutes::%arg 1%} is 0:
            set {_time} to 15 minutes
        else if {mutes::%arg 1%} is 1:
            set {_time} to 30 minutes
        else if {mutes::%arg 1%} is 2:
            set {_time} to 2 hours
        else if {mutes::%arg 1%} is 3:
            set {_time} to 1 day
        else if {mutes::%arg 1%} is higher or equal to 4:
            set {_time} to 7 days
        add 1 to {mutes::%arg 1%}
        set {muted.%arg 1%::time} to {_time}
        arg 2 is not set:
            set {_reason} to ""
        else:
            set {_reason} to "Reason: %arg 2%"
        set {muted.%arg 1%::reason} to arg 2
        set {muted.%arg 1%::when} to now
        message "&7%arg 1% has been muted for %{_time}%. %{_reason}%" #Change to broadcast if you want a global message.
        "%arg 1%" parsed as offline player is online:
            message "&cYou have been muted for %{_time}%. %{_reason}%"  to "%arg 1%" parsed as player
   
on chat:
    {muted.%player%::time} is set
    difference between now and {muted.%player%::when} is higher than {muted.%player%::time}:
        clear {muted.%player%::*}
        stop
    cancel event
    set {_remaining} to {muted.%player%::time}
    remove difference between now and {muted.%player%::when} from {_remaining}
    message "&cYou're muted. You won't be able to speak until %{_remaining}% have passed."

Tell me if it works, as i haven't had time to test it
 
Last edited by a moderator:
Oh. That's actually pretty clever and avoids having to type the timespan that's bugged as hell while using it on a command.

Here, because I may start using it myself too. Know that i only use [<text>] on commands as i like my own errors messages.

code_language.skript:
command /mute [<text>] [<text>]:
    trigger:
        player doesn't have permission "grpcsystems.*":
            message "&cYou have no permission to do this."
            stop
        arg 1 is not set:
            message "&cCorrect usage: /mute <player> <reason>"
            stop
        "%arg 1%" parsed as offline player hasn't played before:
            message "&eWARNING: %arg 1% hasn't played here before."
        {mutes::%arg 1%} is not set:
            set {mutes::%arg 1%} to 0
        {mutes::%arg 1%} is 0:
            set {_time} to 15 minutes
        else if {mutes::%arg 1%} is 1:
            set {_time} to 30 minutes
        else if {mutes::%arg 1%} is 2:
            set {_time} to 2 hours
        else if {mutes::%arg 1%} is 3:
            set {_time} to 1 day
        else if {mutes::%arg 1%} is higher or equal to 4:
            set {_time} to 7 days
        add 1 to {mutes::%arg 1%}
        set {muted.%arg 1%::time} to {_time}
        arg 2 is not set:
            set {_reason} to ""
        else:
            set {_reason} to "Reason: %arg 2%"
        set {muted.%arg 1%::reason} to arg 2
        set {muted.%arg 1%::when} to now
        message "&7%arg 1% has been muted for %{_time}%. %{_reason}%" #Change to broadcast if you want a global message.
        "%arg 1%" parsed as offline player is online:
            message "&cYou have been muted for %{_time}%. %{_reason}%"  to "%arg 1%" parsed as player
  
on chat:
    {muted.%player%::time} is set
    difference between now and {muted.%player%::when} is higher than {muted.%player%::time}:
        clear {muted.%player%::*}
        stop
    cancel event
    set {_remaining} to {muted.%player%::time}
    remove difference between now and {muted.%player%::when} from {_remaining}
    message "&cYou're muted. You won't be able to speak until %{_remaining}% have passed."

Tell me if it works, as i haven't had time to test it


didnt try it but it looks like it doesnt have an integer so I cant check if player is muted or na. I'll use it in my message grpc systems I mean:
if {Chaos.mute.%player%} is "true":
send "&c&n%{Chaos.mutereason.%player%}%: You were muted"
stop
 
didnt try it but it looks like it doesnt have an integer so I cant check if player is muted or na. I'll use it in my message grpc systems I mean:
if {Chaos.mute.%player%} is "true":
send "&c&n%{Chaos.mutereason.%player%}%: You were muted"
stop
code_language.skript:
{muted.%player%::time} is set
this is check
 
it looks like it doesnt have an integer so I cant check if player is muted or na
To check if a player is muted using my system you only need to check if {muted.%player%::time} is set. If it is, it's muted. The reason is {muted.%player%::reason} and when were they muted is {muted.%player%::when}.
You can perfectly check everything.