execute store result storage pctf:random input.x int 1 run random value -20..20
execute store result storage pctf:random input.y int 1 run random value 4..20
execute store result storage pctf:random input.z int 1 run random value -20..20

execute store result storage pctf:random input.x_motion int 1 run random value 0..9
execute store result storage pctf:random input.y_motion int 1 run random value 0..9
execute store result storage pctf:random input.z_motion int 1 run random value 0..9

execute at @a[tag=playing,limit=1,sort=random,gamemode=!spectator] run function pctf:logic/game/coin_rain/drop with storage pctf:random input

scoreboard players remove #coin_loop temp 1
execute if score #coin_loop temp matches 1.. run function pctf:logic/game/coin_rain/loop

scoreboard players reset #coin_rain temp