(CBR) Deadline has learned that "It’s Always Sunny in Philadelphia" co-creator and co-star Rob McElhenney has closed a potentially seven-figure deal with Legendary Pictures to write, produce and direct "Figment."

The film is a family action-adventure comparable to "Goonies" or "E.T." about a hyper-imaginative boy and his family who have to deal with their worst fears given life. McElhenney sold the idea with four-minute test reel comprised of footage he shot for two "Figment" scenes and a 20-minute pitch; Legendary reportedly bought it then and there.

The film will mark McElhenney’s feature debut as both a director and screenwriter. The career development comes after 10 seasons of "It’s Always Sunny in Philadelphia." The show’s 11th season is expected to premiere in early 2015 on FXX.

Copyright © 2014 Comic Book Resources. Reprinted with permission. All rights reserved.