Mute skript

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

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Nicolai120111

Member
Feb 1, 2017
19
0
0
Hello,

I have some trouble with this, every time i muted a player he can still talk in chat...

#------- Code --------#
command /mute [<offline player>] [<number>]:
permission: mute.*
permission message: &cYou do not have permission for that!
executable by: players and console
trigger:
if arg 1 is not set:
message "&c/mute <player> <seconds>"
if arg 1 is set:
set {mute.%arg 1%} to number-argument
broadcast "&b%arg 1% &6was muted by &c%player%"

every 1 second:
loop all players:
if {mute.%loop-player%} is more than 0:
remove 1 from {mute.%loop-player%}
else:
delete {mute.%loop-player%}

on chat:
if {mute.%player%} is true:
cancel event

every 20 seconds:
loop all players:
if {mute.%loop-player%} is more than 0:
set action bar of loop-player to "&6You can talk in &b%{mute.%loop-player%}% &cseconds."

command /unmute [<offline player>]:
permission: mute.*
permission message: &cYou do not have permission for that!
executable by: players and console
trigger:
if arg 1 is not set:
message "&c/unmute <player>"
if arg 1 is set:
delete {mute.%arg 1%}
broadcast "&b%arg-1% &6was unmuted by &c%player%"
 
Please read this tutorial and follow all the steps:
https://forums.skunity.com/threads/how-to-get-help-faster.284/

It's obvious that they can still chat, you're checking if the variable {mute.%player%} is true instead of check if it's set.

Other thing, I would recommend to use list variables instead of single variables, so instead of {mute.%player%} you should use {mute::%player%}
 
Hello,

I have some trouble with this, every time i muted a player he can still talk in chat...

#------- Code --------#
command /mute [<offline player>] [<number>]:
permission: mute.*
permission message: &cYou do not have permission for that!
executable by: players and console
trigger:
if arg 1 is not set:
message "&c/mute <player> <seconds>"
if arg 1 is set:
set {mute.%arg 1%} to number-argument
broadcast "&b%arg 1% &6was muted by &c%player%"

every 1 second:
loop all players:
if {mute.%loop-player%} is more than 0:
remove 1 from {mute.%loop-player%}
else:
delete {mute.%loop-player%}

on chat:
if {mute.%player%} is true:
cancel event

every 20 seconds:
loop all players:
if {mute.%loop-player%} is more than 0:
set action bar of loop-player to "&6You can talk in &b%{mute.%loop-player%}% &cseconds."

command /unmute [<offline player>]:
permission: mute.*
permission message: &cYou do not have permission for that!
executable by: players and console
trigger:
if arg 1 is not set:
message "&c/unmute <player>"
if arg 1 is set:
delete {mute.%arg 1%}
broadcast "&b%arg-1% &6was unmuted by &c%player%"
Put the code in paste in please.
 
Status
Not open for further replies.