The Philadelphia-born comedian auctioned off the role as part of the "All-in Challenge," which raises money to feed those in need during the pandemic.
Henry Law, an anesthesiologist from Cherry Hill, was the winner.
Over 37,000 people donated to be in Hart's movie.
During a video call, Law explained to an "All-In Challenge" representative why he felt it was important to donate.
"When I go to work, it's hard to see patients that are scared and I'm the guy that's a lot of times the last person they talk to and see before they get intubated and that's heartbreaking at work. Then coming back home, it's hard to see so many people losing jobs and unemployed and because of that struggling to have efficient food for their family," Law said.
Law said he grew up in an immigrant family and his parents owned a small business.
Hart then surprised Law on the call that was posted to Instagram.
"This is bigger than big. Henry, I want to congratulate you. You are winner!" Hart said. "You will be in my next movie!"
Because he won, Law will say a line in the movie, as well as get his own trailer and assistant.
Law told Hart he goes to 76ers games and sees the actor all the time.
"Seeing you this happy makes me happy," Hart said.
Michael Rubin, co-owner of the 76ers and founder of Fanatics which runs the challenge, joined the call, too.
Rubin said when he heard a 76ers fan won he had to talk to him.
The "All-In Challenge" has raised more than $42-million.
And there are still dozens of celebrity auctions available.
MORE COVID-19 COVERAGE
President Trump to visit Lehigh Valley Thursday with focus on medical, COVID-19 testing stockpiles
Some Pa. counties continue on path to defy governor's orders
Jersey shore officials weigh options, some look for guidance ahead of Memorial Day weekend
CVS opening drive-thru COVID-19 testing sites around Philadelphia area on Friday
Warning on fake stimulus checks, phishing scams
Bill to allow cocktails to-go passes Pennsylvania Senate
Face masks and mandatory selfies for drivers: How Uber rides are about to change
Cats can infect other cats with coronavirus, researchers find
Share your coronavirus story with Action News
Nominate a 6abc Hometown Hero
For more updates related to the coronavirus, visit 6abc.com/coronavirus