Jump to content

Queue System


sloashy

Recommended Posts

How do I make a queue system on my server. I am currently making an anvil game where anvils fall and you have to dodge them. I want a queue system so not as many afk people get in the game. Example: right click a sign and your in the queue, right click the sign again and you leave the queue. Then you teleport to a box where the game starts. The players will spawn in random positions in the box and also the anvils will spawn randomly on the top of the box and each wave there will come more anvils. Winner gets coins and is able to buy cosmetics and items.

 

If anyone can help me. Reply to this thread. Thanks for reading.

Sincerily

iaryx

Link to comment
Share on other sites

on right click on (item):
  if {queue::%player%} is "true":
    send "&cYou're already in the queue!" to player
  else:
    if {queue::%player%} is "false":
      set {queue::%player%} to "true":
      send "&aYou have joined the queue." to player
# other code

If you need any other help, DM me on discord @skRecipe@2126

hello am preludal but u can call me preludail. thanks forwatching my signature                                                          

Link to comment
Share on other sites

options:
	maxplayers: 4
	signline1: [Queue]
	signline2: Anvil


function joinQueue(p: player):
	if size of {anvilQueue::*} is less than {@maxplayers}:
		add {_p} to {anvilQueue::*}
		set {_size} to size of {anvilQueue::*}
		loop {anvilQueue::*}:
			send "&a%{_p}% &7joined the queue (&a%{_size}%&a/&a{@maxplayers}&7)" to loop-value
			checkQueue()


function checkQueue():
	if size of {anvilQueue::*} is {@maxplayers}:
		loop {anvilQueue::*}:
			send "&aGame starting in 10 seconds!" to loop-value
		wait 10 seconds
		if size of {anvilQueue::*} is less than {@maxplayers}:
			loop {anvilQueue::*}:
				send "&cThe game does not have enough players to start!" to loop-value
		else:
			#Your code to start the game


on rightclick:
	if clicked block is sign:
		if line 1 is "{@signline1}":
			if line 2 is "{@signline2}":
				joinQueue(player)

I tested this and all you need to do is add what you want the queue to do!

 

izzzzthewiz

Discord: izzzzthewiz#3840

Edited by izzzzthewiz
No Errors
  • Thanks 1

» IGN: _iZ_ «

» Joined: 12/18/2016 «

» VIP: 1/13/2018 «

» Helper: 1/29/2021 «

» [<3]: 5/8/2021 «

» Skript dev «

» Discord: iZz#0420 «

I have diabetes

React to this if I was helpful, found this interesting, or you're just nice 🙂

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