Jump to content

Simple Chat-Clear Skript


Wolfeee_

Recommended Posts

Hey! I just created an Simple Chat-Clear skript, and it is parsed with no errors. So I hope you enjoy it! By the way, change "[ServerName]" with your server-name. You may also change the color of the text. If you don't know how to do that, then watch a video on color codes or search it up.

Here's the skript!:

 

command /clear [<text>]:
	permission: staff.clear
	permission message: &cYou may not execute this command!
	trigger:
		if arg-1 is not set:
			send "&cUsage: /clear chat"
		if arg-1 is "clear":
			loop 250 times:
				broadcast ""
			broadcast ""
			broadcast "&b[ServerName]"
			broadcast "&c%player% &7has just cleared the chat!"
			broadcast ""
			stop
			

IGN: Wolfeee_
Discord: Nathan.#4380


00243044b4b99f59989b7171466e765c.png

a.png

Link to comment
Share on other sites

A couple of things to fix:

1. No need for "stop"

2. You wrote in the usage that the command is /clear chat but the command would only work if the player types /clear clear

3. After you finished looping there is no need for 4 more broadcasts, use one

4. You should just use if arg-1 is "chat": and else:

Link to comment
Share on other sites

  • 4 years later...

Hey,

i tried that skript and it broadcasted the message but didnt clear chat please help 

this is the skript i used

command /clear [<text>]:
	permission: staff.clear
	permission message: &cYou may not execute this command!
	trigger:
		if arg-1 is not set:
			send "&cUsage: /clear chat"
		if arg-1 is "clear":
			loop 250 times:
				broadcast ""
			broadcast ""
			broadcast "&b[ServerName]"
			broadcast "&c%player% &7has just cleared the chat!"
			broadcast ""
			stop
Link to comment
Share on other sites

  • 3 weeks later...
On 1/27/2024 at 5:54 PM, 123456789hsoikhtgt said:

Hey,

i tried that skript and it broadcasted the message but didnt clear chat please help 

this is the skript i used

command /clear [<text>]:
	permission: staff.clear
	permission message: &cYou may not execute this command!
	trigger:
		if arg-1 is not set:
			send "&cUsage: /clear chat"
		if arg-1 is "clear":
			loop 250 times:
				broadcast ""
			broadcast ""
			broadcast "&b[ServerName]"
			broadcast "&c%player% &7has just cleared the chat!"
			broadcast ""
			stop

the client you're using probably disables messages without characters in them
or you are using an anti-spam mod
 

Link to comment
Share on other sites

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...