Kieran Hodson was so up to his neck in mounting gambling debts that he took the matter into his own hands by going tooled up into South Cliff Post Office on Filey Road, a court heard.
Hodson, 24, admitted attempted robbery and possessing an offensive weapon when he appeared at York Crown Court on Friday.
It is understood Hodson demanded money from a female shop worker and she hit the panic button to raise the security screen over the counter.
Vandalised Scarborough allotments to be restored as council approves plans to help tackle hundreds stuck on waiting lists
Post-war asbestos bungalows to be demolished in Scarborough as plans for new terraced homes approved
COURT: Scarborough brothers threw man around 'like a rag doll' during vicious street attacks
Scarborough seaweed farm SeaGrown win Government contract to help increase renewable energy
Tractor fire forces police to close road through High Marishes near Malton
The court heard that Hodson had racked up more than £18,000 of debts after becoming addicted to online gambling and falling into the hands of loan sharks.
Hodson’s solicitor advocate Graham Parkin said his client’s parents had “emptied their savings” by paying out £16,000 to clear most of their son’s debts.
However, it was the interest on those payments demanded by “street lenders” that had prompted Hodson, in desperation, to raid the post office.
Following the botched robbery, Hodson called his father and told him what had happened “because he didn’t have the nerve to ring the police”.
Hodson, of Ramshill Road, Scarborough, was “making sure everybody knew”.
He owned up to the incident after being arrested for the offences which occurred on March 22.
Hodson had been remanded in Hull Prison where he had asked for “assistance” from staff after suffering from night terrors and sleeplessness.
Mr Parkin said that Hodson and his girlfriend had received threats from the loan sharks.
“He was borrowing money to try and chase the (betting) losses and he borrowed it from street lenders who of course have their own enforcement process,” added the lawyer.
He said that Hodson’s parents were no longer prepared to “simply pay off the debt because, as (Hodson’s) father said, he didn’t learn the lesson and…he needed to deal with the (betting) addiction rather than (his parents) simply bailing him out”.
Prosecutor Matthew Collins said the unusual - albeit highly serious - incident was “not what one might call a callous robbery”.
“There’s clearly something more to it,” he added.
Judge Sean Morris, the Recorder of York, adjourned sentence for probation reports to establish the true extent of Hodson’s betting addiction.
“I would like to know more about him,” added Mr Morris.
He said that, before sentence, he would also like to know the name of the online gambling company on whose website Hodson had frittered away so much money.
“That might be an important part of my sentencing remarks,” added the judge.
Adjourning sentence for six weeks, Mr Morris told Hodson: “You have been made aware of the serious nature of this offence (but) your guilty plea will stand you in good stead as far as length (of prison sentence) is concerned.”
Hodson will learn his fate on June 4. He was remanded in custody until then.
Advice on problem gambling
GamCare offers free information, support and counselling for problem gamblers in the UK.
It runs the National Gambling Helpline - 0808 8020133 - and also offers face-to-face counselling.
For more information visit www.gamcare.org.uk
The NHS's advice for people with gambling addictions includes paying important bills, such as mortgages, on payday before they gamble, spending more time with family and friends who do not gamble and deal with debts rather than ignoring them.
They urge people not to view gambling as a way to make money but as entertainment instead, not to bottle up worries about gambling and to talk to someone, and not to take credit cards with them when they go gambling.
Advice on debt
Citizens Advice has information and can offer advice to people in debt and about loan sharks.
For more information visit www.citizensadvice.org.uk or call their advice line on 0800 1448848.