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