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

tag @s add upgrade_temp
execute if score #random2 temp matches 1 as @a[distance=..250] if score @s ctf_ID = @n[tag=upgrade_temp] ctf_ID run function pctf:logic/items/lucky_block/outcomes/positive/team/upgrade/types/armor
execute if score #random2 temp matches 2 as @a[distance=..250] if score @s ctf_ID = @n[tag=upgrade_temp] ctf_ID run function pctf:logic/items/lucky_block/outcomes/positive/team/upgrade/types/melee
tag @s remove upgrade_temp

execute if score #random2 temp matches 1 run tellraw @a[distance=..250] ["",{"selector":"@s","color":"white"},{"text":"'s","color":"white"},{"text":" team received Armor Tier Upgrades!","color":"aqua"}]
execute if score #random2 temp matches 2 run tellraw @a[distance=..250] ["",{"selector":"@s","color":"white"},{"text":"'s","color":"white"},{"text":" team received Melee Weapon Tier Upgrades!","color":"aqua"}]