NEW BRUNSWICK -- He stood in the fifth-floor hallway of the Middlesex County Courthouse Wednesday afternoon, anxious and agitated, intensely debating his attorney and himself whether to take a plea deal of probation or to opt for trial and risk potentially 15 or even 30 years in prison.

Just hours earlier, 48-year-old Carlo Goias, whose stage name is Carlo Bellario, of Toms River, -- the actor/comedian charged with weapons possession for having a BB gun while filming a movie in Woodbridge last year -- firmly said he planned to reject the deal from the county Prosecutor's Office and let a jury decide his fate.

"It's a matter of principle. It's going to be a nightmare," Goias said in the hallway, referring to the prospect of serving probation.

At a preliminary hearing in March, he didn't waver in rejecting the prosecution's plea offer of three years in prison.

But on Thursday, after being continually reminded by his attorney, Jef Henninger, of the risks of rejecting the plea, Goias finally acquiesced and agreed to plead guilty to a charge of creating false public alarm.

"You know what's a nightmare? Maximum security prison for 15 years," Henninger responded.

Goias paused and with a subtle chuckle said, "I don't even know if I have 15 years left."

Goias slowly moved about the hallway in a walker that he needs after a recent surgery to remove a tumor from his leg.

Henninger later found out that if Goias opted for trial, he potentially faced 30 years due to his past record, which includes six prior convictions in two states, including charges of theft, credit card theft, and burglary, according to court records.

Police last November found Gioas in possession of the BB gun while filming a movie called "Vendetta Games" in a residential neighborhood in Woodbridge. Henninger said if Goias were to be convicted at trial, the court could have the discretion to tack on additional time -- potentially issuing a 15-year prison sentence.

"So it could be 15 years, and then the judge could put 15 years on top of that," Henninger said.

Goias, appearing subdued, said, "I just want it to be over. I don't agree with it, but you know what, I am out of jail, and I don't ever have to see these people again."

Inside the courtroom, Goias appeared before Superior Court Judge Alberto Rivas, who went through some procedural matters before finalizing the plea agreement.

Middlesex County Assistant Prosecutor Bina Desai went over some of the details of the incident that led to Goias's arrest.

"The scene involved you being in a motor vehicle and you were holding the gun out the window as part of the scene," she said, as Goias affirmed the statement.

She said neighbors had no reason to assume that a movie was being filmed instead of it appearing that there was actual danger present.

Henninger noted during the hearing that Goias planned to sue the production company of the movie, Epyx Productions.

Desai then asked Goias to affirm that if the Prosecutor's Office decided to bring charges against those who gave him the gun, that he would provide truthful testimony if called to be a witness.

Rivas then accepted the plea agreement and scheduled Goias's sentencing for Oct. 14 at 1:30 p.m.

Spencer Kent may be reached at skent@njadvancemedia.com. Follow him on Twitter @SpencerMKent. Find the Find NJ.com on Facebook.