execute if score .host_mode settings matches 1 unless entity @s[tag=op] run return run tellraw @s {"text":"\nYou do not have permission to start a match in Host Mode! To toggle Host Mode an operator must type `/function pctf:host_mode/toggle`","color":"red"}
execute if entity @e[tag=not_active,tag=finished] run return run function pctf:logic/lobby/left_in_edit

execute store result score .total_players temp run execute if entity @a

execute if score .total_players temp matches 1 if score .game_in_progress lobby matches 1 run function pctf:stop_all_games/start

execute if score .game_in_progress lobby matches 1 run return run function pctf:logic/lobby/late_join/late_start with storage pctf:map input
execute if score .time_till_tp countdown matches 1.. run tellraw @a {"text":"Stopped countdown!","color":"red"}
execute if score .time_till_tp countdown matches 1.. run return run scoreboard players set .time_till_tp countdown 0

execute as @a at @s run playsound minecraft:block.note_block.pling master @s ~ ~ ~ 2 0

scoreboard players set .time_till_tp countdown 200

scoreboard players add @a coins 0

title @a times 0 5 5