
scoreboard players operation money_check b = money_count b

execute if score money_check b matches ..99999998 run scoreboard players set buy_3 b 3
execute if score money_check b matches 99999999.. run scoreboard players set buy_3 b 2

execute if score buy_3 b matches 2 run replaceitem entity @a[hasitem={item=c:house,quantity=0}] slot.hotbar 4 c:house 1 0 {"minecraft:item_lock":{"mode":"lock_in_inventory"}}
execute if score buy_3 b matches 2 run playsound c.money @a
execute if score buy_3 b matches 2 run scoreboard players remove money_count b 99999999
execute if score buy_3 b matches 2 run scoreboard players operation §e¥所持金 i = money_count b
execute if score buy_3 b matches 2 run function z/story/story_end