A teenager found with almost £5,000 in cash has been sentenced for involvement in the supply of cannabis.