Jump to content

I need help with a mute skript


Meow_Squad

Recommended Posts

I tried to make a skript for muting people because there are people that spam on the server. I need help trying to figure it out though. 

command /mute <player> <number>:
	permission: op
	permission message: &cNot today, nor Tomorrow.
	trigger:
		add uuid of "%arg-2%" to {Muted::*}
		send "&cYou have been muted for %arg-2% minutes." to "%arg-1%" parsed as player
		wait "%arg-2%" minutes
		remove "%arg-2%"'s uuid from {Muted::*}
		send "&aYour mute has expired!" to "%arg-1%" parsed as player

command /unmute <player>:
	permission: op
	permission message: &cNot today, nor Tomorrow.
	trigger:
		if "%arg-1%"'s uuid is not in {Muted::*}:
			send "&cThat player is already unmuted!" to player
		else:
			remove "%arg-1%"'s uuid from {Muted::*}
			send "&aYou have been unmuted!" to "%arg-1%" parsed as player
			send "&aUnmuted %arg-1%&a!"
			
on chat:
	if {Muted::*} contains player's uuid:
		cancel event
		send "&cYou are currently muted!" to player

 

Errors: 

Line 13: Can't understand this condition/effect: add uuid of "%arg-2%" to {Muted::*} (line 13: add "%arg-2%"'s uuid to {Muted::*}')

Line 16: Can't understand this condition/effect: remove "%arg-2%"'s uuid from {Muted::*} (line 16: remove "%arg-2%"'s uuid from {Muted::*}') (The Parser doesn't support every syntax element.)

Line 23: Can't understand this condition: '"%arg-1%"'s uuid is not in {Muted::*}' (line 23: if "%arg-1%"'s uuid is not in {Muted::*}:')

Line 25: 'else' has to be placed just after another 'if' or 'else if' section (line 25: else:')

Link to comment
Share on other sites

So for the first 2 errors you are trying to add a number's uuid to a list which isn't possible. What you want to be doing is adding the specified player's uuid to this list so instead of using arg-2 you need to use arg-1 as the first argument is a player. For the 3rd error I believe you need to use 'doesn't contain'. I fixed the code here:

command /mute <player> <number>:
	permission: op
	permission message: &cNot today, nor Tomorrow.
	trigger:
		add uuid of "%arg-1%" to {Muted::*}
		send "&cYou have been muted for %arg-2% minutes." to "%arg-1%" parsed as player
		wait "%arg-2%" minutes
		remove "%arg-1%"'s uuid from {Muted::*}
		send "&aYour mute has expired!" to "%arg-1%" parsed as player

command /unmute <player>:
	permission: op
	permission message: &cNot today, nor Tomorrow.
	trigger:
		if {Muted::*} doesn't contain "%arg-1%'s uuid:
			send "&cThat player is already unmuted!" to player
		else:
			remove "%arg-1%"'s uuid from {Muted::*}
			send "&aYou have been unmuted!" to "%arg-1%" parsed as player
			send "&aUnmuted %arg-1%&a!"
			
on chat:
	if {Muted::*} contains player's uuid:
		cancel event
		send "&cYou are currently muted!" to player

 

Edited by ApexSplat

Discord: Dead#6905

Love anime!


Anime Gifs

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...