*You replied before me...I just explained it in a nooby way so he will understnad.
You don't need a script. You can use a series of events to do what your trying to do.
First make an event.
1. Use a conditional branch. Set it so that you need x amount of gold or more.
2. Now use the "Change Gold..." event command.and place it where the red circle is in the picture. Set it at decrease and then were it says constant, place the amount of money is taken away. It should look somthing like the picture below.
3. Next use the "Show Text" command. Then type what you want it to say.
4. Make another event command under your conditional branch where it says "else" Place the text you want there.
When your done the events should look somthing like this but with the different text that you chose and the different amount of money you chose.
Hope that helped.