Money could end some problems. For example, if you're really rich, you would no longer need to work. So if your shyness is causing you problems getting a good job, that problem would be solved!
But you could still be lonely! Maybe even more lonely, because you no longer have as much of an incentive to get out there.
However, if you were really rich, and drove a fancy sports car, etc., you could attract the opposite sex that way. But would they like you for yourself or just for your money? That is always the question. So you could still be lonely.
Some people, however, I guess don't care whether someone likes them for themselves or their money, just as long as they have somebody around.
That doesn't describe me, but everyone is different.