tag @s[scores={attribute_point=1..}] add can_upgrade

tag @s[tag=can_upgrade,tag=elf,tag=!Berserk,scores={stat_dex=3..}] remove can_upgrade
 
tellraw @s[tag=elf,tag=!Berserk,scores={stat_dex=3..,attribute_point=1..}] {"rawtext":[{"text":"§cElves reached the Dexterity limit (3)!"}]}

tag @s[tag=can_upgrade,tag=!elf,tag=!Berserk,scores={stat_dex=2..}] remove can_upgrade

tellraw @s[tag=!elf,tag=!Berserk,scores={stat_dex=2..,attribute_point=1..}] {"rawtext":[{"text":"§cDexterity limit (2) reached for this race!"}]}

scoreboard players remove @s[tag=can_upgrade] attribute_point 1
scoreboard players add @s[tag=can_upgrade] stat_dex 1
tellraw @s[tag=can_upgrade] {"rawtext":[{"text":"§aDexterity Increased!"}]}
playsound random.levelup @s[tag=can_upgrade]

tellraw @s[scores={attribute_point=..0}] {"rawtext":[{"text":"§cNot enough points!"}]}

tag @s[tag=can_upgrade] remove can_upgrade