#spawn mobs around the arena
execute if score .room_count room matches ..8 if score .enemy_spawn_cooldown arena matches ..0 if score .stage arena matches 1.. if score .points arena matches 1.. as @a run function main:game/wave/spawn/spawnpoint

#cooldown
execute if score .enemy_spawn_cooldown arena matches ..0 if score .enemies arena matches ..50 run execute store result score .enemy_spawn_cooldown arena run random value 20..40

#reduce cd by 1 per tick
execute if entity @a[tag=!choice] if score .enemy_spawn_cooldown arena matches 1.. run scoreboard players remove .enemy_spawn_cooldown arena 1
execute if score .enemy_spawn_cooldown_1 arena matches 1.. if entity @a[tag=!choice] run scoreboard players remove .enemy_spawn_cooldown_1 arena 1