Kodak Black is turning a new leaf now that he's out of prison and he's doing it with the help of Master P.

Master P tells us the two linked after Kodak's interview on "The Breakfast Club" in January where he mentioned he'd want P to mentor him. Word got to Master P and he's been teaching Kodak the ropes of the music biz and now feels like a father figure to the young rapper.

It explains why Kodak popped up at a celebrity basketball game for Team Hope NOLA, Master P's foundation, in June, right after he got out of the pen for violating his house arrest.  

Their next project is a back-to-school fundraiser on August 14 in Pompano Beach, Florida, Kodak's hometown, where they plan on giving away school supplies to over 1300 kids. We're told the event means a lot to Kodak who wants to stress the importance of education.