$tag @n[type=marker,tag=blue_flag_dropoff,scores={map_id=$(map_id)}] remove captured_light_purple
$tag @n[type=marker,tag=blue_flag_dropoff,scores={map_id=$(map_id)}] remove captured_yellow
$tag @n[type=marker,tag=red_flag_dropoff,scores={map_id=$(map_id)}] remove captured_aqua
$tag @n[type=marker,tag=red_flag_dropoff,scores={map_id=$(map_id)}] remove captured_green

$execute at @n[type=marker,tag=map_lobby,scores={map_id=$(map_id)}] run tag @a[distance=..24] remove has_flag
$execute at @n[type=marker,tag=map_lobby,scores={map_id=$(map_id)}] run tag @a[distance=..24] remove has_yellow_flag
$execute at @n[type=marker,tag=map_lobby,scores={map_id=$(map_id)}] run tag @a[distance=..24] remove has_aqua_flag
$execute at @n[type=marker,tag=map_lobby,scores={map_id=$(map_id)}] run tag @a[distance=..24] remove has_light_purple_flag
$execute at @n[type=marker,tag=map_lobby,scores={map_id=$(map_id)}] run tag @a[distance=..24] remove has_green_flag

$scoreboard players set #tick_second game$(map_id) 0
$scoreboard players set #seconds game$(map_id) 60

$function pctf:logic/game/scoreboard_setup {map_id: "$(map_id)"}

execute if score .apocalypse settings matches 0 run time set 6000
execute if score .apocalypse settings matches 1 run time set 18000

$tag @n[type=marker,tag=map_lobby,scores={map_id=$(map_id)}] add in_game
$scoreboard players set @n[type=marker,tag=map_lobby,scores={map_id=$(map_id)}] countdown 140