A teenager stole a £1,000 bike from a garage - then returned it after realising that it belonged to a friend.
John Joe Smith, 19, admitted burglaries at two properties in the same street.
His solicitor said that the teen, of Northway in London Park, Mirfield, fell in with the wrong crowd.
Vanessa Jones, prosecuting, said that Smith targeted addresses in Sunny Bank Road in Mirfield.
On June 27 Leon Nicholson was heading to work at 5am when he noticed that his garage door was wide open.
It had been entered via a hole made in the metal door and a £1,000 motorcross bike was taken.
On July 27 at 4am Smith was seen near another property with another male.
Mrs Jones said: “The member of the public asked what he was doing and he replied: ‘It wasn’t me that stole the scooter’.”
Smith was then seen lying on his front in the garden while the other male searched inside an outbuilding.
The witness tried to detain him inside until police arrived but Smith escaped.
Andy Day, mitigating, said that his client was thoroughly ashamed of himself.
He said: “It (the bike) turned out to belong to a friend of his and once this was known he has apologised and returned the bike undamaged.
“In the second matter he played a lesser role but is not prepared to say who was with him.
“Since this he has made serious efforts to avoid the people he had been associating with.”
Magistrates gave Smith a 12 month community order as a direct alternative to prison.
This includes 100 hours of unpaid work and a curfew for eight weeks.
Smith must also pay £60 victim surcharge.