scoreboard players set @s edgeJ 0

spawnpoint @s 4 32 41

execute if score game Stats matches 1 if score @s gameid = gameid Stats at @s run scoreboard players operation @s lives < @a[scores={lives=1..},distance=0.0001..] lives
execute if score game Stats matches 1 if score @s gameid = gameid Stats run function mctsts:game/death
execute if score game Stats matches 1 unless score @s gameid = gameid Stats run gamemode spectator @s
execute if score game Stats matches 1 unless score @s gameid = gameid Stats run tp @s @r[gamemode=adventure]

execute if score game Stats matches 0 run clear @s
execute if score game Stats matches 0 run effect clear @s
execute if score game Stats matches 0 run gamemode adventure
execute if score game Stats matches 0 run tp @s 4 32 41 0 0

schedule clear mctsts:lobby/update_signs
schedule function mctsts:lobby/update_signs 100t