scoreboard players reset @s

scoreboard players set @s join 100

#default to zoom level 4
tag @s[tag=!zoom1,tag=!zoom2,tag=!zoom3,tag=!zoom4,tag=!zoom5,tag=!zoom6] add zoom4
scoreboard players set @s[tag=zoom1] zoomLevel 1
scoreboard players set @s[tag=zoom2] zoomLevel 2
scoreboard players set @s[tag=zoom3] zoomLevel 3
scoreboard players set @s[tag=zoom4] zoomLevel 4
scoreboard players set @s[tag=zoom5] zoomLevel 5
scoreboard players set @s[tag=zoom6] zoomLevel 6

stopsound @s
team join player @s
xp set @s 0 levels
xp set @s 0 points
effect clear @s

scoreboard players operation @s char_set_x = global start_x
scoreboard players operation @s char_set_y = global start_y
scoreboard players operation @s char_set_z = global start_z
scoreboard players operation @s faceDirection = global start_f

gamemode adventure @s[tag=!admin]
tp @s 44 83 29 90 10
clear @s[tag=!admin]
title @s times 0 65 10
title @s actionbar [""]
title @s subtitle [""]
title @s title [""]

#lone player? make sure lobby is loaded
tag @s add self
execute if entity @s[tag=!admin] unless entity @a[tag=!self] run function bd:reset_global
tag @s remove self

tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":"Welcome to Doze Off!","color":"#FFAA00","bold":true}]
tellraw @s ["",{"text":"Interact with one of the signs to start playing."}]
tellraw @s ["",{"text":" "}]

tag @s remove inControl
scoreboard players set @s inputCooldown 0
scoreboard players set @s actionbarState 1

team join nocollide @s
function bd:game/check_for_advancements

execute unless entity @s[scores={playerID=1..}] run function bd:player_get_id

scoreboard players set @s ambientTime1 100
scoreboard players set @s ambientTime2 600