# Title & scores
execute store result score players vars if entity @a[tag=!spectate]
execute if score players vars matches 11.. run scoreboard players set players vars 10
execute store result score readyPlayers vars if entity @a[tag=ready,tag=!spectate]
title @a[tag=!chamber] actionbar [{"text":"Stand in the Tutorial Room to start!","color":"white"},{"text":"  [","color":"white"},{"score":{"name":"readyPlayers","objective":"vars"},"color":"gray"},{"text":"/","color":"gray"},{"score":{"name":"players","objective":"vars"},"color":"gray"},{"text":"]","color":"white"}]

# Ready and unready
execute positioned -21.0 100 -2.0 as @a[dx=3.5,dz=4,dy=5,tag=!ready,tag=!spectate] at @s run function chop:lobby/ready
execute positioned -21.0 100 -2.0 as @a[distance=7..,tag=ready] at @s run function chop:lobby/unready

# Start tutorial
execute if score readyPlayers vars matches 1.. if score readyPlayers vars = players vars run function chop:lobby/tutorial/start