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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
on join:
set {%player%.mute} to false
stop
on quit:
clear {%player%.mute}
stop
on chat:
if {%player%.mute} is true:
message "&cYou are muted!"
cancel event
stop
command /mute <text="">:
trigger:
if player has permission "chat.mute":
loop all players:
if "%arg 1%" is "%loop-player%":
if {%loop-player%.mute} is true:
message "&cPlayer is alredy muted!"
else:
set {%loop-player%.mute} to true
message "&aYou have muted &6%name of loop-player%!"
message "&cYou were muted from &6%name of player%!" to loop-player
stop trigger
message "&cPlayer not found!"
else:
message "&cNo Permission!"
stop trigger
command /unmute <text="">:
trigger:
if player has permission "chat.unmute":
loop all players:
if "%arg 1%" is "%loop-player%":
if {%loop-player%.mute} is false:
message "&cPlayer isn't muted!"
else:
set {%loop-player%.mute} to false
message "&aYou have unmuted &6%name of loop-player%!"
message "&aYou were unmuted from &6%name of player%" to loop-player
stop trigger
message "&cPlayer not found!"
else:
message "&cNo Permission!"
stop trigger
No I think there isn't such function. But you can script the mute-system yourself. Here is an examle you could use:
code_language.skript:on join: set {%player%.mute} to false stop on quit: clear {%player%.mute} stop on chat: if {%player%.mute} is true: message "&cYou are muted!" cancel event stop command /mute <text="">: trigger: if player has permission "chat.mute": loop all players: if "%arg 1%" is "%loop-player%": if {%loop-player%.mute} is true: message "&cPlayer is alredy muted!" else: set {%loop-player%.mute} to true message "&aYou have muted &6%name of loop-player%!" message "&cYou where muted from &6%name of player%!" to loop-player stop trigger message "&cPlayer not found!" else: message "&cNo Permission!" stop trigger command /unmute <text="">: trigger: if player has permission "chat.unmute": loop all players: if "%arg 1%" is "%loop-player%": if {%loop-player%.mute} is false: message "&cPlayer isn't muted!" else: set {%loop-player%.mute} to false message "&aYou have unmuted &6%name of loop-player%!" message "&aYou where unmuted from &6%name of player%" to loop-player stop trigger message "&cPlayer not found!" else: message "&cNo Permission!" stop trigger
So you only have to set the permissions:
chat.mute - /mute <player>
chat.unmute - /unmute <player>
So I hope this helps. i haven't testet it ye but it should work.
Thanks! but i trust more in the essentials mute system, i have more safety and control (like time and more)
Im pretty newbie in skript, and all the info is in English, so its difficult to me understand some things.So, it is also possible to implement timed mute... So are there other features that you would like to have in an mute system? And as long as the script is running it cannot be unsafer as essentials
command /mute [<player>]:
trigger:
if arg-1 is not set:
send "&cWho do you wan't mute?"
else:
if {Mute::%arg-1%} is set:
send "&cHe is already muted?"
else:
set {Mute::%arg-1%} to true
send "&cHe is now muted by you"
send "&7You has been muted by %player%" to arg-1
command /unmute [<player>]:
trigger:
if arg-1 is not set:
send "&cWho do you wan't mute?"
else:
if {Mute::%arg-1%} is not set:
send "&cHe is not muted?"
else:
delete {Mute::%arg-1%}
send "&cHe is now unbemuted"
send "&7You has been &cUN&7muted by %player%" to arg-1
on chat:
if {Mute::%player%} is set:
cancel event
send "You can't chat somethings. you been muted!"
Im pretty newbie in skript, and all the info is in English, so its difficult to me understand some things.
By the way, I "solve" this with an -on chat- event, if you are able to chat means that you are not muted. So i made a variable that sets muted to true, ans if you talks its sets to false
@Spirit1998HD
Nice code. but can you maybe try to remove the useless Variables? D: xD
example. You don't need "on join" events and "on quit" just do this simple. and smaller. and effiferzen
code_language.skript:command /mute [<player>]: trigger: if arg-1 is not set: send "&cWho do you wan't mute?" else: if {Mute::%arg-1%} is set: send "&cHe is already muted?" else: set {Mute::%arg-1%} to true send "&cHe is now muted by you" send "&7You has been muted by %player%" to arg-1 command /unmute [<player>]: trigger: if arg-1 is not set: send "&cWho do you wan't mute?" else: if {Mute::%arg-1%} is not set: send "&cHe is not muted?" else: delete {Mute::%arg-1%} send "&cHe is now unbemuted" send "&7You has been &cUN&7muted by %player%" to arg-1 on chat: if {Mute::%player%} is set: cancel event send "You can't chat somethings. you been muted!"
Yeah, thats the right way and this what @ChisleLP posted is a compact version of mine .
Yep, that would be clever. I don't think about that . But the on join event has an smal anti-error function. So if you forgot to unmute somebody, the script will do this. If you add this to the script it will be a perfect mute system
command /mutelist:
trigger:
if {Mute::*} is set:
send "List of Mute:"
loop {Mute::*}:
send "- %loop-index%"
else:
send "Wow. No one Muted?"
I already finish my skript yesterday with the new version of WolvSKYou can use WolvSK for check if a player is muted with Essentials