execute if score #toggle timestop.dummy matches 1 if entity @a[gamemode=!spectator] run function timestop:go
execute unless score #toggle timestop.dummy matches 1 unless entity @a[gamemode=!spectator] run function timestop:stop

schedule function timestop:five_second_clock 5s