If a price says $40,000 is that all you have to pay?

Is the money listed all? or do buyers have to take over payments?

It depends. Given that you posted this in the buying at auction forum, I’ll assume that is what you are referring to. First thing I should not is that buying at foreclosure auction presents a number of risks that are particular to it, and should only be attempted by those who have taken the time to familiarize themselves with those risks and the auction process.
As for the sale amount there are two things you need to know. 1) that amount is often discounted, in fact it is discounted by 31% on average throughout the state, with larger discounts in the hardest hit areas, and smaller discounts in the strongest markets. 2) that amount is for “the loan in foreclosure”. If that loan happens to be for the first mortgage, you don’t need to worry about paying for junior mortgages - a? second mortgage for example. If that amount is for a second mortgage and you buy it at auction, you will still have to pay off the first mortgage.
We attempt to identify which loan is first, second, etc, within ForeclosureRadar, but note that you should not rely on these and need to verify title before making any purchase.
This is a very brief overview - there are additional and important things to know, like the fact that property taxes are always senior and must be paid, or that the IRS has a right of redemption even if their lien is junior to the loan you are purchasing