ok so im making this queue system for a minigame recreation called BattleBox.
so far i can join queue and it says how many players are in queue and all of that but if i try and leave queue the count down keeps going in chat and the titles keep popping up pls help. Also feel free to mess around with this and send me a better version of this but the same idea thanks <3.
[doublepost=1669626201,1669625918][/doublepost]I am also using a skript addon called Skellet < only addon of skript i have and also this is supposed to be working on a server version 1.18.2
so far i can join queue and it says how many players are in queue and all of that but if i try and leave queue the count down keeps going in chat and the titles keep popping up pls help. Also feel free to mess around with this and send me a better version of this but the same idea thanks <3.
Code:
# tbh idky i have this variable
variables:
{queue.player} = 0
# this is just a kill effect thing it works fine for the most part
on death of player:
send title "&f[&a&f]&c %victim%" to attacker for 3 seconds
launch ball colored yellow at attacker's location with duration 1
#command to queue into a game
command /battleboxqueue:
trigger:
# this is to make sure player is in queue and counts as a player in queue
if {queue} does not contain player:
add player to {queue.player}
add 1 to {queue.player}
set {queue} to true
else:
remove 1 from {queue}
remove player from {queue.player}
# now this part here vvvvv makes a count down from 20 seconds and titles show up and sounds are played and countdown in chat
teleport player to spawn of world "BattleBox1"
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
send title "&a20 seconds to match start" to player for 3 seconds
broadcast "&a20 seconds to match start!"
broadcast "&e(&b%{queue.player}%&e/&b12&e) %player% has joined &6Battle Box"
wait 10 seconds
send title "&a10 seconds" to player
broadcast "&a10 seconds to match start!"
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
wait 5 seconds
send title "&a5 seconds" to player
broadcast "&a5 seconds to match start!"
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
wait 1 seconds
send title "&a4 seconds" to player
broadcast "&a4 seconds to match start!"
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
wait 1 seconds
send title "&a3 seconds" to player
broadcast "&a3 seconds to match start!"
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
wait 1 seconds
send title "&a2 seconds" to player
broadcast "&a2 seconds to match start!"
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
wait 1 seconds
send title "&a1 second" to player for 1 seconds
broadcast "&a1 second to match start!"
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
wait 1 seconds
delete {queue}
# this is supposed to make the player leave the queue but it redoes the other command from b4 and I just want this so the player leaves queue and stops the titles from showing and stops the countdown in chat
command /battleboxqueueleave:
trigger:
if {queue} = true:
remove player from {queue}
remove 1 from {queue}
set {queue} to false
else:
stop