
execute as @a[scores={checkpoint=32}] at @s run execute as @s[y=58,dy=0] at @s run function koncept:return_stage with storage stage:checkpoint

execute as @a[scores={checkpoint=32,checkpoint_between_32=0}] at @s positioned 1 77 -23 if entity @s[distance=..3] run tag @s add return_stage_checkpoint_message
execute as @a[scores={checkpoint=32,checkpoint_between_32=0}] at @s positioned 1 77 -23 if entity @s[distance=..3] run spawnpoint @s 1 77 -23 -38.40
execute as @a[scores={checkpoint=32,checkpoint_between_32=0}] at @s positioned 1 77 -23 if entity @s[distance=..3] run scoreboard players set @s checkpoint_between_32 1


#323201 323202 323203 323204

execute positioned 7 81 -14 if entity @a[distance=..6] run scoreboard players set 323201 timer_an 1
execute if score 323201 timer_an matches 1 run scoreboard players add 323202 timer_an 1

execute if score 323202 timer_an matches 5 run function koncept:level/31/main

execute if score 323202 timer_an matches 35 run scoreboard players reset 323201 timer_an
execute if score 323202 timer_an matches 35 run scoreboard players reset 323202 timer_an
execute if score 323202 timer_an matches 35 run scoreboard players reset 323203 timer_an
execute if score 323202 timer_an matches 35 run scoreboard players reset 323204 timer_an


execute as @a[scores={checkpoint=32}] at @s positioned -13 88 -38 if entity @s[distance=..1.5] run schedule function koncept:teleport6 5t append
execute as @a[scores={checkpoint=32}] at @s positioned -13 88 -38 if entity @s[distance=..1.5] run tp @s -8.51 62.00 -19.83 -626.44 9.07

execute as @a[scores={checkpoint=32}] at @s if block ~ ~-0.1 ~ minecraft:magma_block run playsound minecraft:entity.enderman.teleport block @s ~ ~ ~ 1111 1
fill -22 85 -6 -2 72 -24 minecraft:soul_sand replace minecraft:green_concrete
fill -22 85 -6 -2 72 -24 minecraft:magma_block replace minecraft:red_concrete

execute as @a[scores={checkpoint=32}] at @s if block ~ ~-0.1 ~ minecraft:magma_block run tp @s -21.62 84.00 -5.58 -7338.29 10.84
#execute as @s at @s if block ~ ~-1 ~ minecraft:soul_sand run tp @s -21.62 84.00 -5.58 -7338.29 10.84