tellraw @a[distance=..250] ["",{"text":"Every player on ","color":"aqua"},{"selector":"@s","color":"white"},{"text":"'s","color":"white"},{"text":" team gained ","color":"aqua"},{"text":"Coins","color":"gold"},{"text":"!","color":"aqua"}]

execute store result storage pctf:coins input.amount int 1 run random value 25..40

tag @s add coin_temp
execute as @a[distance=..250] if score @s ctf_ID = @n[tag=coin_temp] ctf_ID run function pctf:logic/player/coins/set_coins_to_add with storage pctf:coins input
tag @s remove coin_temp