execute at @s run tp @s ~1000 228 ~1000
#say looping
scoreboard players add @s map_maker_id 1
execute at @s if entity @e[type=marker,tag=map_lobby,tag=!not_active,distance=..1] run return run function pctf:mode/z_map_maker/tp_loop
execute at @s if entity @e[type=marker,tag=map_lobby,tag=ignore_me,distance=..1] run return run function pctf:mode/z_map_maker/tp_loop

execute store result storage pctf:map_location input.map_id int 1 run scoreboard players get @s map_maker_id

#say found empty slot
execute at @s run setblock ~ 99 ~ minecraft:bedrock
execute at @s positioned ~ 100 ~ run function pctf:create_game_object/center with storage pctf:map_location input
execute at @s positioned ~ 228 ~ run function pctf:create_game_object/lobby/map with storage pctf:map_location input
execute at @s positioned ~ 228 ~ run fill ~10 ~-1 ~10 ~-10 ~5 ~-10 minecraft:barrier outline
execute at @s positioned ~ 227 ~ run setblock ~ ~ ~ yellow_stained_glass
execute at @s run tp @s ~ 100 ~

tellraw @s ["",{"text":"This is Map ","bold":true,"color":"light_purple"},{"score":{"name":"@s","objective":"map_maker_id"},"bold":true,"color":"light_purple"}]

execute at @s store result score #check_markers temp run execute if entity @e[type=marker,tag=map_center,distance=..2]
execute if score #check_markers temp matches 2.. run function pctf:mode/z_map_maker/abort