$execute unless score @s gems matches $(reroll_scrolls).. run return run tellraw @s {"text":"You don't have enough gems! ($(reroll_scrolls)g)","color":"red"}

$function pctf:logic/player/gems/remove {amount: "$(reroll_scrolls)"}

clear @s *[custom_data~{wizard_battle:1b}]

function pctf:logic/player/weapons/melee