A Kirkcaldy man bought cocaine with an inheritance and then sold the drugs to a friend under the noses of police officers.
Filip Hibner was spotted in a car with a friend by officers on patrol.
As they watched, the 25-year-old passed a bag containing white powder to the other man.
A search of Hibner’s vehicle uncovered drugs worth more than £1,000, as well as cash.
Fiscal depute Jill Currie told Kirkcaldy Sheriff Court the total weight of the drugs was 13g.
She estimated the street value of the powder to be £1,040.
Cash and powder found in car
Ms Currie said: “At around 5pm on April 24 police in uniformed patrol observed a black Audi RS5 blocking the single carriageway with his hazard lights on.
“This was causing traffic to build up.
“Police pulled up alongside to check on the welfare of the occupants.
“There were two males within and both exited the vehicle to talk with police.
“The accused had been the driver and was seen passing an item to the passenger and in return, the passenger passed the accused cash.”
This led officers to search the car and they uncovered one larger and several smaller bags of white powder, along with £500 in cash.
Hibner, of Valley Gardens South, had previously admitted being concerned in the supply of the Class A drug.
£2,000 inheritance blown on cocaine
His solicitor told the court Hibner had been suffering from low mood and had started taking drugs.
After receiving an inheritance of around £2,000 from an uncle, he bought “more cocaine than he would normally”.
He added: “This was mainly so he had a stock to fund his new habit.
“He sold some to a friend who was going to a party.
“Before his friend got out of the car he sold him cocaine.
“It’s his position that it was a one-off incident – because he had this supply he decided to sell it to a friend.
“He experienced a rush of adrenaline.
“This, for a short time, helped him feel a bit better.”
Sheriff Lindsay Foulis told Hibner it was in his favour that he was a first time offender but future convictions would see him risking jail.
He ordered him to carry out 200 hours of unpaid work.