Lindsay Lohan Will Shoot Episode for Charlie Sheen's 'Anger Management' Before Rehab

The starlet plans to tape her cameo before completing a court-mandated rehab stint.

CHARLIE SHEEN and LINDSAY LOHAN in SCARY MOVIE 5

Lindsay Lohan has her priorities in order.

Before she enters a court-mandated, 90-day rehab stint, E! News reports that the troubled starlet will fulfill a work obligation: a guest starring role on friend Charlie Sheen's FX comedy, "Anger Management."

[Related: Lindsay Lohan's Hall of Shame: A Look Back at Her Five Mug Shots]

In February, reports revealed that Lohan would play a version of herself and have "a romantic relationship with Sheen's character after becoming his therapy patient."

It seemed to be a perfect promotional opportunity, as the two share a bedroom scene in April's "Scary Movie 5."

But earlier this week, Lohan pled no contest to lying to police, obstructing officers, and reckless driving related to a car crash last June. She managed to avoid jail time when the judge sentenced her to 90 days in a lockdown rehab facility, as well as 30 days of community service and 18 months of psychotherapy. Lohan was also ordered to pay the truck driver she hit on the way to the set of the Lifetime movie "Liz and Dick."

[Related: Lindsay Lohan Headed to 'Lock Down' Rehab: What She Can Expect]

Her lawyer, Mark Heller, claimed this would be the end of Lohan's legal issues. "I'm very confident that you won't be seeing Lindsay Lohan in any criminal courts any time in the future," Heller said. "She has fully recognized all of the issues that have to be addressed, and I'm very confident she'll be able to move forward in her life with dignity, pride, and respect."

[Related: Lindsay Lohan: Why She’s Sticking With Her Questionable Lawyer]

Lohan has until May 2 to find a program that meets with the court's approval. So until then, she has time to film her "Anger Management" cameo and even promote the release of "Scary Movie 5."

It's the least she can do for Sheen, who gave her $100,000 of his "Scary Movie" paycheck to help pay back taxes and bought a red carpet gown for her to wear to an AmfAR gala.

Earlier this month, Sheen even offered to become Lohan's mentor. He sent TMZ a statement saying, "I have a kinship with somebody [Lindsay] who clearly needs a mentor, whether she wants one or not. She can continue to hang out with her dress shredding club buddies, or turn to me for some advice from a guy who's been down the road as well as every other side trail on the journey." He continued, "If she listens, she'll win. If she doesn't, that's on her."