Queue Skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

sheorex

Member
Sep 14, 2023
10
0
1
26
I want to make a queue system, if 2 players are in a queue then one player will auto execute a command and the other player will be auto teleported to him.
(the players will be removed from the queue after they get teleported)

Could anybody help me with that?
 
I want to make a queue system, if 2 players are in a queue then one player will auto execute a command and the other player will be auto teleported to him.
(the players will be removed from the queue after they get teleported)

Could anybody help me with that?
Do you have code? if not, then this is not me helping you, this is a request. in that case, I would recommend reposting this in the right section (and deleting this post).
 
I want to make a queue system, if 2 players are in a queue then one player will auto execute a command and the other player will be auto teleported to him.
(the players will be removed from the queue after they get teleported)

Could anybody help me with that?
I can help, though.
 
I want to make a queue system, if 2 players are in a queue then one player will auto execute a command and the other player will be auto teleported to him.
(the players will be removed from the queue after they get teleported)

Could anybody help me with that?
I LITERALLY JUST FINISHED AND IT WIPED MY PROGRESS
 
I want to make a queue system, if 2 players are in a queue then one player will auto execute a command and the other player will be auto teleported to him.
(the players will be removed from the queue after they get teleported)

Could anybody help me with that?
It is done. In fact, it is right here.
 
This code was somewhat tested. If you still have issues, make a conversation about it.
 
I want to make a queue system, if 2 players are in a queue then one player will auto execute a command and the other player will be auto teleported to him.
(the players will be removed from the queue after they get teleported)

Could anybody help me with that?
Btw, if you ever decide to send me your current code, I could make the code that I have compatible.
 
It is done. In fact, it is right here.
I can‘t see wehre the first player or second player execute anything, I mean

- if 2 players are in a queue then one will execute the command /rtp (random teleport plugin) and then the second will be auto teleported to the first player who auto executed /rtp

(I don’t need a location in the queue)
I’m very new at Skript and just starting to learn it and queue is some stuff that I can’t do currently, so yeah I’m requesting a Skript
 
I can‘t see wehre the first player or second player execute anything, I mean

- if 2 players are in a queue then one will execute the command /rtp (random teleport plugin) and then the second will be auto teleported to the first player who auto executed /rtp

(I don’t need a location in the queue)
I’m very new at Skript and just starting to learn it and queue is some stuff that I can’t do currently, so yeah I’m requesting a Skript
Ohhhhhhhh

Yeah, that's do-able. My bad, I didn't understand what you wanted.
 
Meh, oh well. Here's the code:

Code:
on load:
    if {numqueue} is not set:
        set {numqueue} to 2

command /queue:
    trigger:    
        if {queue::%player%} <= 0:
            if {queue::*} = {numqueue}:
                set {queue::*} to 0
                send "&7Teleporting..." to {queuetp::*}
                teleport {queuetp::*} to {loc}
                clear {queuetp::*}
            else:
                send "&aYou have been added to the queue!"
                add 1 to {queue::%player%}
                set {queuetp::%player%} to player
        else:
            send "&cYou are already in this queue!" to player

command /setloc:
    permission: op
    trigger:
        set {loc} to player's location
        send "&aSuccessfully set location to &3%{loc}%&a."

command /setqueue <number>:
    usage: &cAdd a number to set a queue! the default number is 2.   
    permission: op
    trigger:
        set {numqueue} to arg-1
        send "&aSuccessfully set queue to &3%{numqueue}%&a."
 
Oh wait wrong one. Hehe, here's the right one:

Code:
on load:
    if {numqueue} is not set:
        set {numqueue} to 2
    loop all players:
        if {queueset::%loop-player's uuid%} is not set:
            set {queueset::%loop-player's uuid%} to false
        else:
            exit loop

command /queue:
    trigger: 
        if {queueset::%player's uuid%} is false:
            if {queue::*} >= {numqueue}:
                set {queue::*} to 0
                send "&7Teleporting..." to {queuetp::*}
                execute player command "/rtp"
                teleport {queuetp::*} to player
                clear {queuetp::*}
                set {queueset::*} to false
            else:
                send "&aYou have been added to the queue!"
                set {queueset::%player's uuid%} to true
                set {queuetp::%player's uuid%} to player
                add 1 to {queue::*}
        else:
            send "&cYou are already in this queue!" to player

command /setqueue <number>:
    usage: &cAdd a number to set a queue! the default number is 2.
    permission: op
    trigger:
        set {numqueue} to arg-1
        send "&aSuccessfully set queue to &3%{numqueue}%&a."

command /resetqueue:
    permission: op
    trigger:
        clear {queuetp::*}
        set {queue::*} to 0
        set {queueset::*} to false
        send "&aSuccessfully cleared queue!"
 
Last edited:
Oh wait wrong one. Hehe, here's the right one:

Code:
on load:
    if {numqueue} is not set:
        set {numqueue} to 2

command /queue:
    trigger:   
        if {queue::%player%} <= 0:
            if {queue::*} >= {numqueue}:
                set {queue::*} to 0
                send "&7Teleporting..." to {queuetp::*}
                execute player command "/rtp"
                teleport {queuetp::*} to player
                clear {queuetp::*}
            else:
                send "&aYou have been added to the queue!"
                add 1 to {queue::%player%}
                set {queuetp::%player%} to player
        else:
            send "&cYou are already in this queue!" to player

command /setqueue <number>:
    usage: &cAdd a number to set a queue! the default number is 2.  
    permission: op
    trigger:
        set {numqueue} to arg-1
        send "&aSuccessfully set queue to &3%{numqueue}%&a."

command /resetqueue:
    permission: op
    trigger:
        clear {queuetp::*}
        clear {queue::*}
        send "&aSuccessfully cleared queue!"

It says "You are already in the queue" when typing /queue