Josh Segarra has been cast in one of the lead roles in NBC’s upcoming pilot based on the film “Night School.”

Segarra will play Teddy Walker, described as a charming salesman, in the multi-camera comedy pilot. The role was played in the film by Kevin Hart. Segarra joins previously announced cast member Shanola Hampton, who will play the character that was played by Tiffany Haddish in the film version, as well as Ian Gomez, Collette Wolfe, James Earl, and Joe Massingill.

Like the film, “Night School” follows a a unique mix of adults at a night school GED prep class who unexpectedly bond over their shared experience and find themselves helping each other both inside and outside of the classroom.

Segarra’s recent credits include shows like “Arrow,” “Orange Is the New Black,” “The Moodys,” “AJ and the Queen,” “The Other Two,” “Chicago P.D.,” and “Sirens.” He has also appeared in films like Amy Schumer’s “Trainwreck” and “Overboard” and lent his voice to the hit video game “Red Dead Redemption.”

He is repped by A3 Artists Agency, ATA Management, and Jackoway Austen Tyerman.

Kevin Hart — who starred in, co-wrote and produced the film — will executive produce the pilot along with Will Packer, who was also a producer on the film, and Malcolm D. Lee, who directed. Chris Moynihan will write and executive produce the pilot. Universal Television will serve as the studio, with Universal Pictures having produced the film. Hart will produce under his Hartbeat Productions banner while Packer will do so via Will Packer Media and Moynihan via Bicycle Path Productions. Bryan Smiley and Tiffany Brown will oversee for HartBeat while Sheila Ducksworth will executive produce for Will Packer Media.