Jump to content

SETCODE [EVENT SERVER]


Recommended Posts

Credits:
MasterClashers (I saw this on his stream and skripted it for my self)

What this skript does:
You can set a custom code to whatever you like and then reveal it on the stream, everyone in the stream can then type /joinevent [<code>] to join the event. You can also make it so donors can join the queue first or everyone can join the queue system. You can also set the size of the queue.


CODE:

command /event [<text>] [<text>]:
	permission: staff
	trigger:
		if arg-1 is not set:
			send "&c/event (queue/start/stop) (donor/all)"
		else if arg-1 is not "queue" or "start" or "stop":
			send "&c/event (queue/start/stop) (donor/all)"
		else if arg-2 is not "donor" or "all":
			send "&c/event (queue/start/stop) (donor/all)"
		if arg-1 = "queue":
			if arg-2 = "donor":
				broadcast ""
				broadcast "&6&lEvent Queue: &7Event queue has been opened up for &a($) %nl% &7to join the event type /joinevent [code]"
				broadcast ""
				set {queueopen} to "donor"
			if arg-2 = "all":
				broadcast ""
				broadcast "&6&lEvent Queue: &7Event queue has been opened up for everyone %nl% &7to join the event type /joinevent [code]"
				broadcast ""
				set {queueopen} to "all"


command /setcode [<text>]:
	permission: staff
	trigger:
		set {code} to arg-1
		send "&cYou have set the code to %arg-1%&c!"

command /setqueuesize [<integer>]:
	permission: staff
	trigger:
		if arg-1 is not set:
			send "&cThe current queue size is %{eventsize}%&c!"
		else:
			set {eventsize} to arg-1
			send "&cYou have set the event size to %arg-1%&c!"

command /joinevent [<text>]:
	trigger:
		if {queueopen} = "donor":
			if {rank::%player's uuid%} is not "host" or "mod" or "$":
				send "&cSorry! You cannot join the event at this time!"
			else:
				if arg-1 is not {code}:
					send "&cIncorrect code!"
				else:
					if size of {event::*} >= {eventsize}:
						send "&cQueue is full!"
					else:
						if {event::*} doesn't contain player:
							add player to {event::*}
							send "&aCorrect code!"
							broadcast ""
							broadcast "&6&lEvent Queue: &7%player% &7has joined the queue (%size of {event::*}%/%{eventsize}%)"
							broadcast ""
						else:
							send "&cYou are already inside of the queue!"
		else if {queueopen} = "all":
			if arg-1 is not {code}:
				send "&cIncorrect code!"
			else:
				if size of {event::*} >= {eventsize}:
					send "&cQueue is full!"
				else:
					if {event::*} doesn't contain player:
						add player to {event::*}
						send "&aCorrect code!"
						broadcast ""
						broadcast "&6&lEvent Queue: &7%player% &7has joined the queue (%size of {event::*}%/%{eventsize}%)"
						broadcast ""
					else:
						send "&cYou are already inside of the queue!"

 

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