A man caught with more than £14,000 worth of cannabis plants was selling the drug to pay off debts, a court has heard.
Ian Walle was sentenced at Kirkcaldy Sheriff Court after being caught with the sizeable haul on September 27 last year.
The 35-year-old, of Rowan Crescent in Methil, was given a Community Payback Order and told to perform 200 hours of unpaid work to be completed within 12 months.
Walle, a former businessman, was also placed under supervision for 18 months and warned that any breach of the CPO would see him sent straight to prison.
Defence solicitor Dewar Spence told Sheriff James Williamson that his client had faced “significant difficulties” since being caught with the 38 cannabis plants.
He said: “The position of Mr Walle is that he was doing this to clear debts. He was not going to receive anything from this. It was all to go to a third party.
“It was suggested to him by other people that this was a way in which he could get out of debt. It has caused significant difficulties for him.
“Him and his wife have separated because of his involvement in this case and it has also caused his father significant difficulties.”
Mr Spence asked that the Sheriff order Mr Walle to perform unpaid work as he has proven himself to be capable in the past.
He said: “In all the years that I have acted for Mr Walle, he has been a businessman, he knows how to put his work to good use.
“He is somebody who has the potential to return to the status he was in before.”
Sheriff James Williamson said: “I’m just and only just prepared to deal with this by way of a non-custodial sentence.
“But if you breach the order Mr Walle, I will send you to prison.”