# Lobby

execute if score el_lobby scenes matches 1 run playsound elevator_button master @a ~ ~ ~ 99999
execute if score el_lobby scenes matches 1 run scoreboard players set el_button_allow map 0
execute if score el_lobby scenes matches 1 run data merge entity @e[tag=elevator_button,name=lobby,limit=1] {item:{id:"minecraft:coal",Count:1b,tag:{CustomModelData:72}}}
execute if score el_lobby scenes matches 20 run data merge entity @e[tag=elevator_button,name=lobby,limit=1] {item:{id:"minecraft:coal",Count:1b,tag:{CustomModelData:71}}}


execute if score el_lobby scenes matches 50 run playsound minecraft:elevator_arrive master @a 20 -10 -66 1

execute if score el_lobby scenes matches 210 run playsound minecraft:elevator_open master @a 18 -10 -66 1
execute if score el_lobby scenes matches 190 run playsound minecraft:elevator_ring master @a 21 -8 -67 1
execute if score el_lobby scenes matches 190 run setblock 20 63 -66 light[level=11]
execute if score el_lobby scenes matches 210..230 as @e[tag=lobby,name=elevator_door_left] at @s run tp @s ~ ~ ~-0.05
execute if score el_lobby scenes matches 210..230 as @e[tag=lobby,name=elevator_door_right] at @s run tp @s ~ ~ ~0.05
execute if score el_lobby scenes matches 230 run setblock 18 -9 -66 minecraft:air
execute if score el_lobby scenes matches 200 run execute as @e[tag=lobby,name=elevator_door_left] at @s run tp @s 18.5 ~ -65.5
execute if score el_lobby scenes matches 200 run execute as @e[tag=lobby,name=elevator_door_right] at @s run tp @s 18.5 ~ -65.5

execute if score el_lobby scenes matches 231 if entity @p[x=20,y=-10,z=-66,distance=..1] run scoreboard players set el_lobby scenes 240

execute if score el_lobby scenes matches 240 run setblock 18 -9 -66 minecraft:oak_fence
execute if score el_lobby scenes matches 240 run playsound minecraft:elevator_close master @a 18 -10 -66 1
execute if score el_lobby scenes matches 240 as @e[tag=cleaning_guy] at @s run function animated_java:clean_guy_final/summon
execute if score el_lobby scenes matches 240..260 as @e[tag=lobby,name=elevator_door_left] at @s run tp @s ~ ~ ~0.05
execute if score el_lobby scenes matches 240..260 as @e[tag=lobby,name=elevator_door_right] at @s run tp @s ~ ~ ~-0.05

execute if score el_lobby scenes matches 280 run scoreboard players set elevator_ride ambient 1
execute if score el_lobby scenes matches 750 run scoreboard players set elevator_ride ambient 0
execute if score el_lobby scenes matches 750 as @a at @s run teleport @s ~ ~71 ~

execute if score el_lobby scenes matches 740 run execute as @e[tag=4,name=elevator_door_left] at @s run tp @s 18.5 ~ -65.5
execute if score el_lobby scenes matches 740 run execute as @e[tag=4,name=elevator_door_right] at @s run tp @s 18.5 ~ -65.5

execute if score el_lobby scenes matches 750 run playsound minecraft:elevator_ring master @a 21 64 -67 1
execute if score el_lobby scenes matches 750 run execute as @e[tag=aj.clean_guy_final.root] at @s run function animated_java:clean_guy_final/animations/cleaning/play
execute if score el_lobby scenes matches 751 run scoreboard players set cleaning_guy ambient 1
execute if score el_lobby scenes matches 770 run playsound minecraft:elevator_open master @a 18 62 -66 1
execute if score el_lobby scenes matches 770 run scoreboard players set ambient map 5
execute if score el_lobby scenes matches 770..790 as @e[tag=4,name=elevator_door_left] at @s run tp @s ~ ~ ~-0.05
execute if score el_lobby scenes matches 770..790 as @e[tag=4,name=elevator_door_right] at @s run tp @s ~ ~ ~0.05
execute if score el_lobby scenes matches 790 run setblock 18 62 -66 air

execute if score el_lobby scenes matches 791 if entity @p[x=14,y=61,z=-66,distance=..2] run scoreboard players set el_lobby scenes 800

execute if score el_lobby scenes matches 800 run setblock 18 62 -66 minecraft:oak_fence
execute if score el_lobby scenes matches 800 run playsound minecraft:elevator_close master @a 18 62 -66 1
execute if score el_lobby scenes matches 840 run playsound minecraft:elevator_away master @a 18 62 -66 1
execute if score el_lobby scenes matches 800..820 as @e[tag=4,name=elevator_door_left] at @s run tp @s ~ ~ ~0.05
execute if score el_lobby scenes matches 800..820 as @e[tag=4,name=elevator_door_right] at @s run tp @s ~ ~ ~-0.05
execute if score el_lobby scenes matches 820 run setblock 20 63 -66 air

execute if score el_lobby scenes matches 1..230 run scoreboard players add el_lobby scenes 1
execute if score el_lobby scenes matches 240..790 run scoreboard players add el_lobby scenes 1

execute if score el_lobby scenes matches 800..840 run scoreboard players add el_lobby scenes 1



