tag @s add selected_temp
$execute as @e[type=marker,tag=map_lobby,tag=!selected_temp,tag=finished,tag=!not_active,scores={map_id=$(x)..},sort=nearest,limit=1] if score @s map_id > @n[tag=selected_temp] map_id at @s run return run function pctf:logic/lobby/cycle/new
function pctf:logic/lobby/cycle/reset
tag @s remove selected_temp