A thug pistol-whipped a man and pushed the gun against his forehead shouting: “I’ll end you!”, a court has heard.
Jody Venters made the chilling threats after being given a free carry-out by bar worker William Moir in the Railway Tavern in Buckhaven.
Instead of taking his eight bottles of cider home, Venters struck up a conversation with customer Michael Robinson and started drinking his booze.
A row erupted after a few bottles because Venters mistakenly thought Mr Robinson was making fun of him.
Advocate depute Kenneth Campbell told the High Court in Livingston: “The accused stood up and got in witness Robinson’s face and started shouting: ‘Are you laughing at me?’
“He then lifted his top and revealed a gun in the waistband of his trousers.
“The accused told the witness Moir to turn the CCTV off, however Mr Moir ignored his request at that time and tried to calm the accused down.”
Mr Campbell said Venters then attacked Mr Robinson and repeatedly punched him in the face.
He went on: “The accused then pulled a gun out from the waistband of his jeans and pointed it at witness Robinson and said: ‘I’ll end you, I’ll end you!’
“The accused then hit witness Robinson above his right eye with the butt of the gun. He thereafter pointed the gun and pushed it against witness Robinson’s head.”
Other customers including Venters’ girlfriend Ania Mazur got between the pair. Mr Robinson, who had injuries to his face, left the bar.
Venters, meanwhile, opened another bottle of cider and placed his gun on the bar in full view.
He told Mr Moir to go and check that the CCTV had been wiped and issued a threat.
Mr Moir wiped the CCTV as he was worried about what Venters might do. His manager later decided to report the matter to the police.
Mr Moir identified Venters from a police photo album. He was detained after police stopped his car two months later.
The firearm a potentially lethal handgun designed to fire 4.5mm airgun pellets was found hidden in the bedroom of a flat in Erskine Street.
Venters, 34, of Dalhousie Gardens, Bonnyrigg, East Lothian, pleaded guilty to assaulting Mr Robinson, possessing a firearm, and attempting to pervert the course of justice.
He also changed his plea to guilty on the second day of his trial to a charge of striking Steven Gray on the body with a knife or similar instrument to his severe injury in the Central Bar, Lochgelly, on November 23, 2014.
Temporary judge John Morris called for background reports and told Venters he would pass sentence at the High Court in Edinburgh on October 1.