$execute unless score @s coins matches $(gold_apple).. run return run tellraw @s {"text":"You don't have enough coins! ($(gold_apple)c)","color":"red"}
give @s golden_apple[item_name={"color":"yellow","text":"Gold Apple"}] 1
$function pctf:logic/player/coins/remove {amount: "$(gold_apple)"}