The director and writer of “Weekend at Bernie’s” have sued Fox and MGM over the studios’ alleged failure to pay them profits from the comedy.

Ted Kotcheff, who directed, and screenwriter Robert Kane filed the action Friday in state court in Los Angeles, alleging breach of contract, breach of covenant and implied faith, improper accounting and violations of the California business and professional code. It seeks a declaratory judgment.

The 1989 comedy starred Andrew McCarthy and Jonathan Silverman as employees at an insurance company who are invited by their boss Bernie (Terry Kiser) to his beach house for the weekend after discovering fraud at the company — only to discover that their boss is behind the fraud and has been killed by mobsters.

The suit asserted that the box office gross receipts were more than $30 million and residuals for further venues were more than $16 million. The plaintiffs alleged that they had been deprived of “at least hundreds of millions of dollars” despite delivering what the suit “one of the most hilarious and endearing goofball comedies of the 80s.”

The action alleged Kotcheff and Kane have not been given any accounting or any payments from the comedy.

Kane and Kotcheff allege they individually signed agreements in 1987 which guaranteed them a flat fee. The action said Kane’s agreement while for a percentage of the net profits and Kotchoff’s called for percentage of adjusted gross receipts.

Fox was the distributor of the film. The suit listed MGM as a defendant because producer Gladden Entertainment Co.  transferred all rights to “Weekend at Bernie’s” to MGM after the 1989 release.

MGM had no comment. Fox did not immediately respond.

The complaint seeks a jury trial, unspecified “monetary damages,” general, special and punitive damages as punishment against the studios for their “wanton, willful, and fraudulent conduct” along with a full accounting, legal fees and pre-judgment interest.

Kotcheff and Kane are represented by Stephen Doniger and Scott Burroughs of Culver City firm Doniger/Burroughs APC.