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

tag @s add enchant_temp
execute if score #random2 temp matches 1..3 as @a[distance=..250] if score @s ctf_ID = @n[tag=enchant_temp] ctf_ID run function pctf:logic/items/lucky_block/outcomes/positive/team/enchant/types/armor
execute if score #random2 temp matches 4..5 as @a[distance=..250] if score @s ctf_ID = @n[tag=enchant_temp] ctf_ID run function pctf:logic/items/lucky_block/outcomes/positive/team/enchant/types/melee
execute if score #random2 temp matches 6 as @a[distance=..250] if score @s ctf_ID = @n[tag=enchant_temp] ctf_ID run function pctf:logic/items/lucky_block/outcomes/positive/team/enchant/types/ranged
tag @s remove enchant_temp

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