Building/NPC builder

Hello, I'm trying to get an NPC to "build" something for the player, I want the player to supply said npc with materials and gold and then the npc will construct the bridge. I know how to make the bridge itself work, having it turned off at the start of the game, and then switch this later. But the part where the player would actually buy it is where im stuck. I'm looking for something similar to how Meltys Quest handled this.
I don't think that this requires a plugin, but can be done with straightforward eventing. I am, therefore, moving this to MV Support.

There will be a very significant number of people who will never have even heard of Meltys Quest, let alone played it, but who might know the feature you are referring to from some other source. We therefore ask people not to say "like X game" but to describe it or provide a video of that aspect of the game so that others can understand what is meant. Could you therefore edit your post and provide some detail about what you mean by that.
Thanks.
I want the player to supply said npc with materials

well, obviously that requires a counter.
since you already have the resolution (the building of the bridge itself), all that's left to do is linking that counter with the condition that'll ultimately trigger the bridge.

one way (if you require different materials) would be to compare a variable to [X, Y, Z, ...n] where each one is one material, but taken as a group.
upon the delivery of each material, the NPC would subtract [0, 0, X, 0 .... 0] from the lot, where X is the one material you bring.

for example:
-say you require 10 wood, 10 rope, 5 nails and 25 gold, you'd set the condition to [10, 10, 5, 25]
-upon the delivery of 10 wood and 2 nails, you'd take [10, 0, 2, 0] and subtract it from [10, 10, 5, 25], leaving you with [0, 10, 3, 25]
-validate for total = [0, 0, 0, 0], and that will trigger the next step.

instead of checking for each resource separately, you check for the whole set at once (but you have to remember which is which, because the array of numbers is just numbers, not items)
if you can't make it check for both resources at once, still do the subtraction from the whole set, but one template at a time:
[10, 10, 5, 25] - [10, 0, 0, 0] - [0, 0, 2, 0].

Original thread: https://forums.rpgmakerweb.com/threads/building-npc-builder.107777/