WireImage

ATLANTA (AP) --

A month from beginning a yearlong federal prison sentence, rapper T.I. was in court again Friday, but this time he wasn't in the hot seat.

The 28-year-old performer, whose real name is Clifford Harris Jr., spoke to dozens of high school students half serving juvenile sentences gathered at the Georgia Supreme Court.

"You can see from me that nobody is too rich, too famous, too cool, too good-looking or too young to make a mistake and pay a price for it," said Harris, dressed in jeans, a gray hooded sweat shirt and a blue knit hat. "More important than the mistake you make, though, is what you are able to take away from that mistake. How can you use that mistake to ensure you will never make a similar mistake again?"

He told them to work hard, stay in school and do what is necessary to get what they want in life.

"Education is more important than any material thing you can have," said Harris, who only has a high school diploma. "The things you do not have in your life, the things you do not have in your possession, will be a reflection of the things you have not learned."

He warned the teens from high schools across metro Atlanta to learn from his mistakes, which include a 2008 federal firearms conviction that will send him to prison for a year starting next month. His appearance was part of 1,000 hours of community service he must complete under that sentence.

His legal troubles didn't start there. Harris grew up in one of Atlanta's housing projects and dealt crack while trying to break into the music industry. The students listened intently as he described the prostitutes, drug dealers and junkies he encountered.

He was first arrested at 17 and spent time in jail for violating probation after several other arrests. In 2007, just an hour before he was scheduled to perform at the BET Hip-Hop Awards in Atlanta, authorities arrested him for trying to buy unregistered machine guns and silencers.

Harris, a Grammy winner, has a list of No. 1 hits on his resume, including two off his latest CD, "Paper Trail," which also hit No. 1 on the Billboard charts.