execute store result score #random2 temp run random value 1..15

execute if entity @s[tag=ultra_rare] run scoreboard players set #random2 temp 1

execute if score #random2 temp matches 1 as @a[distance=..250] if score @s real_ID = @n[tag=lucky_block] real_ID run function pctf:logic/items/lucky_block/give/ultra_rare
execute if score #random2 temp matches 2..15 run function pctf:logic/items/lucky_block/outcomes/reroll