What did people do before the invention of money?

They bartered/traded.