execute if score @s melee_lvl matches 4.. run return run tellraw @s {"text":"Your melee weapon tier is already maxed!","color":"aqua"}

clear @s #pctf:melees

scoreboard players add @s melee_lvl 1

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

function pctf:logic/player/weapons/melee