scoreboard players remove @s generic_timer 1
execute if score @s generic_timer matches ..0 run function pctf:logic/items/lucky_block/outcomes/global/redlight_greenlight/game/end

execute as @a[distance=..250,gamemode=!spectator] at @s run function pctf:logic/items/lucky_block/outcomes/global/redlight_greenlight/player/detect_movement

scoreboard players remove @s generic_timer2 1

execute if entity @s[tag=go] if score @s generic_timer2 matches 60 as @a[distance=..250] at @s run function pctf:logic/items/lucky_block/outcomes/global/redlight_greenlight/game/count/3
execute if entity @s[tag=go] if score @s generic_timer2 matches 40 as @a[distance=..250] at @s run function pctf:logic/items/lucky_block/outcomes/global/redlight_greenlight/game/count/2
execute if entity @s[tag=go] if score @s generic_timer2 matches 20 as @a[distance=..250] at @s run function pctf:logic/items/lucky_block/outcomes/global/redlight_greenlight/game/count/1

execute unless entity @s[tag=end] if score @s generic_timer matches 20.. if score @s generic_timer2 matches ..0 run function pctf:logic/items/lucky_block/outcomes/global/redlight_greenlight/game/check

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