I don't know how well this works, but this is how I was told to deal with robbery.
If you have anything substantial to lose, carry two wallets, one in an unconventional place. Put about $100 (with a few ones, so it seems like a real wallet) and some expired or fake credit cards in one as a dummy wallet.
Most robbers just want to get some quick cash, usually for drugs. So they get what they want and slink away, and you only lose $100. If you're traveling in dangerous parts of the world, the police are usually corrupt and you expect such random losses in the form of shakedowns/bribes.