A maniac high on drink and drugs armed himself with an axe and kicked in a pal's front door - all to get his Xbox back.

Ranting Robbie McKelvie, 24, first went to the wrong address and after being directed across the landing started smashing through his friend's door. 

Witnesses saw that he was brandishing an axe in his right hand - and immediately called the police.

Today at Dumbarton Sheriff Court, McKelvie escaped jail and was instead sentenced to 200 hours of unpaid community work.

He was warned the punishment was a direct alternative to prison and if he failed to carry out the work he would go to jail.

At a previous hearing, he'd admitted to breaking into a flat while holding the axe on June 21 2015.

Read more: Sacked carer to be struck off for threats to "blow the faces off" Muslims in vile racist rant

The court heard how occupants of a flat in Clydebank heard a knock at the front door at 8.15pm and upon answering it saw McKelvie standing there. 

Boozed-up McKelvie asked for a man called "Willie" who the resident told him lived in the flat opposite.

Raging McKelvie then kicked in the door of the man he was looking for and went in.

When police arrived they found him in the hallway but could see no sign of a weapon.

But soon afterwards they spotted an axe lying on top of a plastic bag in the hall.

The bag contained an Xbox, two controllers and several games, as well as a laptop and DVDs.

When McKelvie, who was drunk and high on drugs at the time, was arrested, he told police: "I just done the door because Willie has my Xbox".

McKelvie's solicitor Kenny Clark said his client had "no idea" why he told police that "Willie" had his Xbox.

He added: "It is completely untrue.

"He accepts fully well he is responsible for committing these offences.

"Mr McKelvie was very heavily under the influence of drugs and alcohol.

"He was clearly not thinking straight at all." 

Mr Clark said his client had taken "significant steps" and suggested he would benefit from support.

He added he was "willing and able" to do unpaid work. 

Sheriff William Gallacher said the charges were "serious". 

He added: "You were in possession of an axe with the intention apparently of doing something with it.

"These are very serious matters in any view.

"You were clearly affected by drink and or drugs.

"Had you wielded this axe then who knows what the outcome would have been. 

"In the circumstances I don't think it's necessary to impose a custodial sentence." 

McKelvie will carry out 200 hours of unpaid work for the community, which was reduced from 300 hours after he tendered an early guilty plea. 

He will also undergo one year of supervision. 

Sheriff Gallacher added: "If you fail to comply you will be brought back before me and you will go to prison."