Queue System not working (no errors)

  • 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 community!

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

deku0

Member
Aug 7, 2019
1
0
0
As I said in the title, a queue system I made isnt working and I dont know why. There were no errors whatsoever. The specifics are that you can queue for the game but the code below shows that only 2 should be able to queue for a game at once but many are allowed to queue. When players are queued, they aren't being teleported to the arena. Here is the code:

code_language.skript:
command /queue:
    trigger:
        if {q.%player's uuid%} isn't set:
            if {game.%player's uuid%} isn't set:
                if {q} < 2:
                    add 1 to {q}
                    broadcast "&c%player% &ehas joined the queue for arena!"
                    set {q.%player's uuid%} to true
                else:
                    send "&cThe queue is full!" to player
            else:
                send "&cYou are in a game already!" to player
        else:
            send "&cYou are already queued!" to player 
every second:
    if {q} = 2:
        loop all players:
            if {q.%loop-player's uuid%} is set:
                add loop-player to {q::*}
                set {_1} to random player out of {q::*}
                set {_2} to random player out of {q::*}
                set {place1} to location 14, 69, -59 in world "world"
                set {place2} to location 10, 69, -59 in world "world"
                set {q} to "In Progress"
                delete {q.%loop-player's uuid%}
                teleport {_1} to {place1}
                teleport {_2} to {place2}
                set {game.%loop-player's uuid%} to true
on death:
    if {game.%victim's uuid%} is true:
        broadcast "&c%victim% &elost a duel to &f%attacker%"
        make attacker execute command "spawn"
        delete {game.%victim's uuid%} 
        delete {game.%attacker's uuid%}
        add 1 to {wins.%attacker's uuid%}
        send "&fYou've beaten &c%victim% &fin a duel!" to attacker
 
Status
Not open for further replies.