A father-of-two with a drugs problem was found with more than 1,000 tablets of Valium by police.
William Sibley used the drug to keep himself off heroin a court was told.
Sibley, 38, of Palatine Road, Cleveleys, admitted two offences of possessing Valium, theft, damage and possessing an offensive weapon.
He was sentenced to 12 months’ supervision with nine months’ drug rehabilitation and ordered to pay £130 compensation plus £60 victims’ surcharge by Blackpool magistrates.
Nicola Corney, prosecuting, said on March 10 police saw Sibley acting suspiciously on King Street and when they searched him they found he had 1,169 Valium tablets.
On May 7 Sibley took £30 from a woman saying he would get her some Valium, but he did not return. Police found him on May 22 in the town centre with 20 Valium tablets and a lock-knife.
Gerry Coyle, defending, said his client had been brought up as a Jehovah’s Witness in a commune but left on being ostracised after making a complaint against a commune member. He was on the streets and became addicted to heroin.
Sibley later took a degree in information technology and computer science and went into a drug rehab unit. He left the unit because his partner could not cope with the two children alone.
Possession of Valium is illegal without a prescription.