#add tag count_down
execute as @e[tag=count_down,scores={counter=0..}] at @s run scoreboard players add @s counter 1

execute as @e[tag=count_down,scores={counter=20}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 45 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=40}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 44 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=60}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 43 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=80}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 42 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=100}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 41 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=120}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 40 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=140}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 39 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=160}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 38 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=180}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 37 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=200}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 36 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=220}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 35 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=240}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 34 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=260}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 33 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=280}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 32 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=300}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 31 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=320}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 30 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=340}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 29 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=360}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 28 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=380}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 27 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=400}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 26 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=420}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 25 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=440}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 24 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=460}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 23 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=480}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 22 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=500}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 21 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=520}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 20 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=540}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 19 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=560}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 18 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=580}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 17 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=600}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 16 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=620}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 15 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=640}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 14 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=660}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 13 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=680}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 12 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=700}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 11 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=720}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 10 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=740}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 9 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=760}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 8 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=780}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 7 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=800}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 6 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=820}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 5 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=820}] at @s run execute as @a[tag=waiting] at @s run playsound random.pop @s
execute as @e[tag=count_down,scores={counter=840}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 4 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=840}] at @s run execute as @a[tag=waiting] at @s run playsound random.pop @s
execute as @e[tag=count_down,scores={counter=860}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 3 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=860}] at @s run execute as @a[tag=waiting] at @s run playsound random.pop @s
execute as @e[tag=count_down,scores={counter=880}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§b§l>§e§l>"},{"text":"§4§l 2 "},{"text":"§e§l<§b§l<"}]}
execute as @e[tag=count_down,scores={counter=880}] at @s run execute as @a[tag=waiting] at @s run playsound random.pop @s
execute as @e[tag=count_down,scores={counter=900}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§e§l>§b§l>"},{"text":"§4§l 1 "},{"text":"§b§l<§e§l<"}]}
execute as @e[tag=count_down,scores={counter=900}] at @s run execute as @a[tag=waiting] at @s run playsound random.pop @s
execute as @e[tag=count_down,scores={counter=920}] at @s run titleraw @a[tag=waiting] actionbar {"rawtext":[{"text":"§a§l[!!!] START [!!!] "}]}
execute as @e[tag=count_down,scores={counter=920}] at @s run execute as @a[tag=waiting] at @s run playsound mob.enderdragon.growl @a ~~~ 0.2
#cb remove couneter 1 and display
execute as @e[tag=count_down,scores={counter=920}] at @s run tag @s add game_counter
execute as @e[tag=count_down,scores={counter=920}] at @a run tag @a remove waiting
execute as @e[tag=count_down,scores={counter=920}] at @s run tag @s remove count_down
execute as @e[tag=game_counter,scores={counter=920}] at @s run scoreboard players set @s counter 300

execute as @e[tag=game_counter,scores={counter=0}] at @s run function time_is_up
execute as @e[tag=game_counter,scores={counter=0}] at @s run tag @s remove game_counter
