# © Spark Universe, 2023
# authors: destruc7i0n
# description: play the spawn room ambient music
# called by: ./loop by the tutorial_main entity if the tutorial has not been started

# detect when the player count changes and play the music
scoreboard players set .spawn_cnt tut 0
execute positioned -9 3 263 as @a[r=10] run scoreboard players add .spawn_cnt tut 1
execute unless score .spawn_cnt tut = .prev_spawn_cnt tut run music play spark.zombies2.tutorial_hum 1.0 1.0 loop
scoreboard players operation .prev_spawn_cnt tut = .spawn_cnt tut
scoreboard players reset .spawn_cnt tut
