execute if score @s melee_enchant_lvl matches 2.. run return run tellraw @s {"text":"Your melee weapon enchantment level is already maxed!","color":"aqua"}

clear @s #pctf:melees

scoreboard players add @s melee_enchant_lvl 1

tellraw @s {"text":"Your melee weapon was enchanted!","color":"aqua"}

function pctf:logic/player/weapons/melee