Jump to content

Simple Queue Script (Doesn't teleport anywhere, nor clear {onGoing::*})


ign

Recommended Posts

function q(p: player):
    if {q::*} doesn't contain {_p}:
        add {_p} to {q::*}
        if size of {q::*} = 1:
            set {_t} to 3
            loop 3 times:
                wait 1 second
                if size of {q::*} = 1:
                    broadcast "&8[&c»&8] &6The game is starting in &c%{_t}% &6seconds!"
                    remove 1 from {_t}
                    if {_t} is 0:
                        add {q::*} to {onGoing::*}
                        clear {q::*}
                        broadcast "&8[&c»&8] &6The game has begun!"
                        exit loop
                else:
                    broadcast "&8[&c»&8] &6The queue has been stopped due to lack of people! &8[&c%(size of {q::*})%&8]"
                    exit loop
    else:
        remove {_p} from {q::*}
        send "&8[&c»&8] &6You have left the queue! &8[&c%(size of {q::*})%&8]" to {_p}

command q:
    trigger:
        q(player)

Very simple queue script. Doesn't clear the "{onGoing::*}" variable, so may want to add that. It also doesn't teleport you anywhere, but it works in every other way. You can change whatever, I don't really care.

  • I can breathe!

image.jpeg.da6e9ee446cf561d297d7bcc6a704e6d.jpeg

 

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