#playercount
scoreboard players set @e[tag=dummy] playercountcheck 0
execute @a[tag=!spectator] ~ ~ ~ scoreboard players add @e[tag=dummy] playercountcheck 1


#show error title
execute @e[tag=dummy,scores={playercountcheck=1}] ~ ~ ~ execute @a[scores={titledelay=0}] ~ ~ ~ detect ~ ~-1 ~ concrete 15 title @s times 10 50 20
execute @e[tag=dummy,scores={playercountcheck=1}] ~ ~ ~ execute @a[scores={titledelay=0}] ~ ~ ~ detect ~ ~-1 ~ concrete 15 title @s title §4
execute @e[tag=dummy,scores={playercountcheck=1}] ~ ~ ~ execute @a[scores={titledelay=0}] ~ ~ ~ detect ~ ~-1 ~ concrete 15 title @s subtitle §4Need at least 2 players to start!
execute @e[tag=dummy,scores={playercountcheck=1}] ~ ~ ~ execute @a ~ ~ ~ detect ~ ~-1 ~ concrete 15 scoreboard players set @s titledelay 2

execute @e[tag=dummy,scores={playercountcheck=5..}] ~ ~ ~ execute @a[scores={titledelay=0}] ~ ~ ~ detect ~ ~-1 ~ concrete 15 title @s times 10 50 20
execute @e[tag=dummy,scores={playercountcheck=5..}] ~ ~ ~ execute @a[scores={titledelay=0}] ~ ~ ~ detect ~ ~-1 ~ concrete 15 title @s title §4
execute @e[tag=dummy,scores={playercountcheck=5..}] ~ ~ ~ execute @a[scores={titledelay=0}] ~ ~ ~ detect ~ ~-1 ~ concrete 15 title @s subtitle §4Can't start with more than 4 players!
execute @e[tag=dummy,scores={playercountcheck=5..}] ~ ~ ~ execute @a ~ ~ ~ detect ~ ~-1 ~ concrete 15 scoreboard players set @s titledelay 2


#start game
execute @e[tag=dummy,scores={playercountcheck=2..4}] ~ ~ ~ function start_game