npc_assignment: type: assignment debug: true actions: on assignment: - trigger name:click state:true interact scripts: - npc_interact npc_format: type: format format: "<&b> <&f>to you<&co> <&2>" npc_interact: type: interact debug: true steps: 1: click trigger: script: - yaml load:/Shops/npc_shop.yml id:npc_buy - wait 1t - define shop d:npc_shop - inventory open <[shop]> - yaml unload id:npc_buy npc_shop: type: inventory inventory: CHEST title: Loja size: 45 slots: - [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] Procedural Items: - determine npc_shop_handler: type: world events: on player drags in npc_shop: - if ]>: - determine cancelled - if == : - determine cancelled on player clicks in npc_shop: - if == : - determine passively cancelled - if : - if ]>: - if == 0: - narrate "Your inventory has no space!" - stop - take money quantity: - define Item - adjust Item remove_nbt - adjust def:Item Lore:]> - give <[Item]> - narrate "$ has been removed from your wallet." - flag player TotalSpent:+: - stop - else: - narrate "You don't have enough money! Cost: $ Your Money: $" - stop