How to make an NPC talk in exchange for gold?

Let's say that my hero needs some information and the only one who can provide it asks for some gold in exchange of the info: is it possible to set this through events and conditions only or do I need a script?

If the former, please give me the most precise instructions possible: I always have strong difficulties with everything related to switches, variables, and other "magical" features...

Thanks in advance for any help  🙂
Yes, it is very possible to use this through eventing. Here are some photos provided. 🙂

========================

After you create the "Peasant with Information" and supply him with dialogue...

Spoiler
[IMG]http://i.imgur.com/jCAQfoW.png[/IMG]
This is the part where you set up choices of "Yes" or "No" on whether to pay him or not...

Spoiler
[IMG]http://i.imgur.com/SuleSAo.png[/IMG]

[IMG]http://i.imgur.com/FQOKY4h.png[/IMG]
And then, click under the "Yes" branch to edit "X amount of gold" taken from the player for saying "Yes" for the info.

Spoiler
[IMG]http://i.imgur.com/8dNX4ou.png[/IMG]

[IMG]http://i.imgur.com/7fj7rns.png[/IMG]
Feel free to add more dialogue as well after this step. 🙂

And it should look like this once finished...

Spoiler
[IMG]http://i.imgur.com/jCAQfoW.png[/IMG]
Feel free to ask if you need any more information regarding this. 😀
All you need is a simple event, 

Let's assume the NPC is asking for 200 gold pieces.

Show Choice Pay/Not Pay

When Pay

Conditional branch : Gold is 200 or more

When yes:  Dialogue - here you are take the money, blah

Change Gold: minus 200

When no: Hero: Sorry, we don't have that much.

                 NPC: then go do a side quest, kill a few monsters.  No money, no information.

When Not Pay

Dialogue or whatever.

Ninja'd
If you're having problems with switches and variables, then I suggest you go back to the tutorials and work through them until you know how to use them - switches and variables are the most important part of the engine and you NEED to know how to use them if you ever want to make a game with anything moderately complex.

Follow the link in my signature and look for the "Variables Guide" there, that game should give you the basics.
Wow, Tornado Summoner, you deserve your name  😉

However, I realize I've been unclear with my request because I already found what you just explained and successfully implemented such event in my game; the problem which bothers me right now is that, when I test the game, the player can reply "Yes" even without any money, the NPC will provide the info regardless of the quantity of cash in the PC's wallet (which, at the very beginning of the game, is equal to zero; he'll find some later).

What I need is a way to check the amount of gold the PC possesses and, if he hasn't enough, how I could display a message telling to him he should find a job first... That's why I spoke of conditions in my first post, because I believe such a thing is required for this.

If you're having problems with switches and variables, then I suggest you go back to the tutorials and work through them until you know how to use them - switches and variables are the most important part of the engine and you NEED to know how to use them if you ever want to make a game with anything moderately complex.

Follow the link in my signature and look for the "Variables Guide" there, that game should give you the basics.
I know that too, and I already downloaded this guide quite some time ago now but I couldn't understand a thing to it...
I know that too, and I already downloaded this guide quite some time ago now but I couldn't understand a thing to it...
It's a game that you need to play (and solve it's quests) before you can check (and understand) how those quests were made.
Maybe I should give another try to it, yes...
Wow, Tornado Summoner, you deserve your name  😉

However, I realize I've been unclear with my request because I already found what you just explained and successfully implemented such event in my game; the problem which bothers me right now is that, when I test the game, the player can reply "Yes" even without any money, the NPC will provide the info regardless of the quantity of cash in the PC's wallet (which, at the very beginning of the game, is equal to zero; he'll find some later).
Ohh.. Oops! Sorry about the mistake. :\ I should have noticed it though, while I hurriedly posted it. I had forgot to use the conditional branches, otherwise, the player would have been in debt... XD. Ksjp17's solution is the correct answer. 😀

And thanks for the compliment! 😀
To give more detail the conditional I was referring to is:

Select Conditional Branch - tab one of the Event Command Menu

Select Tab 4

The first item is 'Gold'  Select it and the boxes to the right allow you to specify how much gold there should be.

Do that and the engine will automatically determine if the player has enough.  Everything then runs as I described.  You do not need switches or variables.
Yes, that's what I did after having posted my very first reply and it worked, but I forgot to edit my post to say my problem was solved: sorry for the confusion, guys, it has been a complicated day for me...

I believe this topic can now be closed: thanks again to everyone for the help, much appreciated  🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-npc-talk-in-exchange-for-gold.37869/