#Creators raycast
    execute positioned 537 99 -1010 as @a[distance=0..5] at @s run function subchronos:lobby/creators/raycast_ini

#Pig launchers
    execute as @e[type=pig,tag=lobby.launcher] at @s on passengers run function subchronos:lobby/launchers/mount
    execute as @e[type=pig,tag=lobby.launcher,tag=launching] at @s run function subchronos:lobby/launchers/launching

#Falling
    execute as @a[scores={y=..60},distance=0..200,tag=!falling] at @s run function subchronos:lobby/fell
    execute as @a[scores={y=..50},distance=0..200] at @s run function subchronos:lobby/fell2

#Parkour
    execute positioned 542.5 100 -1003.5 at @a[tag=!onParkour,distance=0..1] if block ~ ~ ~ minecraft:heavy_weighted_pressure_plate[power=1] run tag @p add onParkour
    execute as @a[tag=onParkour] at @s run function subchronos:lobby/parkour/tick

#Resis
    effect give @a[distance=0..200] resistance 1 200 true
    effect give @a[distance=0..200] saturation 1 1 true

#Hotbar
    execute as @a if predicate {"condition":"minecraft:inverted","term":{"condition":"minecraft:entity_properties","entity":"this","predicate":{"nbt":"{Inventory:[{components:{\"minecraft:custom_data\":{lobby.dye:1b}}}]}"}}} run function subchronos:lobby/hotbar/get_dye
    execute as @a if predicate {"condition":"minecraft:inverted","term":{"condition":"minecraft:entity_properties","entity":"this","predicate":{"nbt":"{Inventory:[{components:{\"minecraft:custom_data\":{lobby.lang:1b}}}]}"}}} run function subchronos:lobby/hotbar/get_lang_item

#Player count
    scoreboard players set .playerCount temp 0
    execute as @a[scores={spectating=0}] run scoreboard players add .playerCount temp 1

#Cosmetic menu
    execute positioned 534.47 101.88 -996.57 if entity @p[distance=0..5.5] as @a[distance=0..5.5] at @s run function subchronos:lobby/menu/control
    execute positioned 534.47 101.88 -996.57 unless entity @p[distance=0..5.5] run scoreboard players set @a men_cos 1

#Easter Eggs
    execute positioned 492.51 117.50 -999.46 if entity @a[distance=0..2,tag=!unlocked_pk,gamemode=adventure] as @a[distance=0..2,tag=!unlocked_pk,gamemode=adventure] run function subchronos:lobby/eastereggs/parkour
    execute positioned 538.36 89.00 -998.26 as @a[distance=0..3,gamemode=adventure] unless score @s easter_cueva matches 1 run function subchronos:lobby/eastereggs/cave
execute positioned 538.50 89.00 -996.94 if entity @p[distance=0..8] run function subchronos:lobby/eastereggs/cave_main
    execute positioned 543.36 114.00 -989.07 as @a[distance=0..3,gamemode=adventure] unless score @s easter_arbol matches 1 run function subchronos:lobby/eastereggs/tree

#Start button
    execute unless entity @a[name="SubChronos"] if score .playerCount temp matches ..1 unless score .buttonEnabled temp matches 0 run function subchronos:lobby/start_button/disable
    execute unless entity @a[name="SubChronos"] if score .playerCount temp matches 9.. unless score .buttonEnabled temp matches 0 run function subchronos:lobby/start_button/disable

    execute if score .playerCount temp matches 2..8 unless score .buttonEnabled temp matches 1 run function subchronos:lobby/start_button/enable