An offshore worker who armed himself with a knife while on cocaine has been ordered to undertake unpaid work.
Jamie Paterson left his house with the seven-inch blade and almost walked out in front of a car.
The woman driving the vehicle saw the kitchen knife when Paterson, of Kirkcaldy, raised his right arm, and she called police.
Paterson, 29, had been hosting a party at his home in Provost Kay Park on November 4, last year, when he became paranoid about the other people there.
At Kirkcaldy Sheriff Court on Wednesday he was ordered to perform 200 hours of unpaid work. His community payback order also includes 12 months of supervision.
Sheriff James Williamson had warned Paterson at an earlier hearing he could be jailed and said: "The fact that you were walking around the streets whilst under the influence of cocaine with a knife is frankly terrifying."
Paterson, who works on a rig near Denmark, had admitted being in unlawful possession of a knife.
Defence solicitor Graham Inch told the court that Paterson had been paranoid due to excessive substance misuse, mainly cocaine.
He also said his client had been going through a difficult time when the offence occurred, following the death of his mother and his dog.
Paterson had immediately dropped the knife when police officers arrived on the scene.