scoreboard players set max RNG_Constant 20
function backrooms:rng
function backrooms:rng
function backrooms:rng

execute if score RNG RNG_Variable matches 1 in minecraft:overworld run playsound minecraft:custom.beep1 ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 2 in minecraft:overworld run playsound minecraft:custom.train_horn ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 3 in minecraft:the_nether run playsound minecraft:custom.dripping ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 4 in minecraft:the_nether run playsound minecraft:custom.time_loop ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 5 run playsound minecraft:custom.hum1 ambient @a ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 6 in minecraft:overworld run playsound minecraft:custom.hum2 ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 7 in minecraft:overworld run playsound minecraft:custom.hum3 ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 8 in minecraft:overworld run playsound minecraft:custom.hum4 ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 9 run playsound minecraft:custom.hum5 ambient @a ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 10 run stopsound @a
execute if score RNG RNG_Variable matches 11 run playsound minecraft:custom.hum1 ambient @a ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 12 in minecraft:overworld run playsound minecraft:custom.fan ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 13 in minecraft:the_nether run playsound minecraft:custom.infuser ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 14 in minecraft:overworld run playsound minecraft:custom.talking ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 15 in minecraft:overworld run playsound minecraft:custom.highway ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 16 in minecraft:overworld run playsound minecraft:custom.greg ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 17 in minecraft:the_nether run playsound minecraft:custom.horror ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 18 in minecraft:overworld run playsound minecraft:custom.radio ambient @a[distance=0..] ~ ~ ~ 10000 1
execute if score RNG RNG_Variable matches 19 in minecraft:the_nether run playsound minecraft:custom.ship_horn ambient @a[distance=0..] ~ ~ ~ 10000 1

scoreboard players set ambience ambience 0