execute unless score @s pay matches 45.. run return run function ws:store/hat/fail
scoreboard players remove @s pay 45
title @s title {"translate":"luxury.buysuccess","color":"green"}
give @s minecraft:carved_pumpkin[minecraft:custom_data={hat:1},minecraft:custom_model_data=1004,minecraft:custom_name='{"italic":false,"translate":"hat.beanie"}']
execute at @s run playsound minecraft:block.bamboo.break player @s ~ ~ ~ 100