execute if score @s countdown matches 100 run title @a[distance=..24] actionbar {"text":"5","color":"yellow"}
execute if score @s countdown matches 80 run title @a[distance=..24] actionbar {"text":"4","color":"yellow"}
execute if score @s countdown matches 60 run title @a[distance=..24] actionbar {"text":"3","color":"yellow"}
execute if score @s countdown matches 60 as @a[distance=..24] at @s run playsound minecraft:ui.button.click player @s ~ ~ ~ 1 0
execute if score @s countdown matches 40 run title @a[distance=..24] actionbar {"text":"2","color":"yellow"}
execute if score @s countdown matches 40 as @a[distance=..24] at @s run playsound minecraft:ui.button.click player @s ~ ~ ~ 1 0
execute if score @s countdown matches 20 run title @a[distance=..24] actionbar {"text":"1","color":"yellow"}
execute if score @s countdown matches 20 as @a[distance=..24] at @s run playsound minecraft:ui.button.click player @s ~ ~ ~ 1 0

execute if score @s countdown matches 1 run title @a[distance=..24] actionbar {"text":"Starting!","color":"green"}
execute if score @s countdown matches 1 run function pctf:logic/game/start_real with storage pctf:map input

execute if score @s countdown matches 1.. run scoreboard players remove @s countdown 1