IT’S a story of going from rags to riches – and then back to rags again.

And it’s a story the latest Mzansi lottery winner – a Cape Town security guard who scored R64 million last week – should pay special attention to.

In January 1998, Californian James Allen Hayes thought the door to his wildest dreams had been thrown wide open when he won the SuperLotto jackpot.

After tax, James’ take-home loot was US$13,7 million (about R197,2 million).

The then-35-year-old security guard took his good fortune as a licence to spend wildly, splashing out on "Lamborghinis, Porsches and Harleys, million-dollar oceanfront condos (and) extravagant gambling trips to Vegas," according to the Daily Beast.

Within a few years James’ high flying life started unravelling. First, his ex-wife was awarded half his winnings. Then he dug himself into the hole of drug addiction, popping prescription painkillers for a back injury.

In 2007 the party was over. He filed for bankruptcy and moved in as the caretaker into a block of flats. When the building burnt down in January 2017, James lost all his remaining possessions as well as his home.

Unable to find a job, he moved in with a friend.

He also took up heroin – and robbing banks.

"I mentally snapped," he told reporter Natalie O'Neill.

"I was broke, dope-sick, pissed off at the world, living in a garage with my beloved cat looking up at me hungry.

"I would never steal from a working guy. I would never steal an old lady's purse … But I truly thought robbing a bank was a victimless crime, that it's not the teller's money, it's the bank's — and I hate banks."

He was a successful bank robber for a while. He never used a gun, just slipped a note to the bank clerk demanding cash. He wore disguises and made sure he was out of there within three minutes. He scored about US$40 000 (about R576 000).

But his luck ran out after his tenth heist, when he was bust in October last year.

James is currently in jail serving a 33 month sentence, and is due out in 2020. In the meantime he’s working on his autobiography, Lottery to Robbery.

"Having money enabled me to live my wildest dreams," he told the Daily Beast.

"But there's a flip side. It's the lottery curse."

"Money doesn't equal happiness — it can really screw up your life."