A man threatened a petrol station worker with a stun gun during a botched robbery.
Jamie Miller, 22, used the weapon to try to force Alexander Smith, 25, to open the till at the Moto Service Station in Kinross, Perthshire, on February 8, 2012.
He also produced a knife and threatened to stab Mr Smith in a bid to get the money from the till.
The High Court in Edinburgh heard how Mr Smith managed to run away from Finlayson.
However, two days later Miller along with his friend Steven Finlayson, 35, robbed the David Sands corner Store in North Street, Lochgelly, Fife.
The pair managed to get away with £656 before police caught them.
On Monday, Finlayson and Miller pleaded guilty to one charge of armed robbery before judge Lord Pentland.
Miller also pleaded guilty to another charge of attempted armed robbery.
Prosecution lawyer Peter McCormack told the court that Miller, who has 42 previous convictions, had a bottle of Jack Daniels with him when he tried to rob the petrol station at 11.55pm.
Mr McCormack said: "Five minutes before midnight the accused opened the counter hatch and walked through. The complainer could see that he had something in his hand.
"He saw the accused press a button and he saw flashes and a clicking noise and realised that the accused had a black taser or stun gun.
"The accused told the complainer to open the till and when the complainer asked him if he was joking he repeated the demand and pressed the taser button.
"The complainer felt frightened and intimidated and told the accused that he would open the till if the accused put the taser away.
"Eventually the accused put away the taser and pulled out a flick knife. The complainer opened the fire exit door and ran to the main building to raise the alarm."
Mr McCormack also told the court about the second incident which saw the pair threaten shop workers Emma Aird, 28, and Thomas McLean, 21,.
Mr McCormack added: "Sometime after 8.40pm, the two accused came into the shop. After looking around the shop they approached the cash registers and the accused Miller said: 'Open the tills and give us the money.'
"Emma Aird asked him if he was joking and the accused Miller repeated his demand.
"Emma Aird then realised that both accused were wearing blue surgical gloves. The accused Miller produced a kitchen potato knife which was long and brandished it at Emma Aird. She opened a cash register.
"The accused Miller demanded that the witness McLean fill a bag with money and he did so using a David Sands plastic bag.
"The witness Aird then went over to the panic button and activated it. Both accused grabbed the money and ran out of the shop."
Sentence on the pair was deferred until June 14, 2012 in order for the court to obtain reports about their characters. The pair will be sentenced at the High Court in Glasgow.
People who read this story also read
- Two people taken to hospital and main road closed after collision
- Alcohol hand gel banned from hospital beds 'in case people drink it'
- Drunk-driver drove wrong way along motorway while three times over limit
- Man, 23, is sexually assaulted in playground of primary school
- Health warning after potentially harmful algae found in loch