How to make a quick shop

Godot Version

<4.2.2>

Question

<Greetings! I’m super new to game development and am trying to create a quick shop where the player can just purchase an item by walking past the shop with the right amount of coins. Anyone have any idea what that code could look like?>

You can do like define a data variable in a autoload script like Global, it will be dictionary contains the player_data like what he bought (name of the items in array) now in the shop similarly define a data variable and it will contains the properties of the item like price, so you can use Global.data.append(item_name) function to buy the item