FBI agents watched as Lopez walked up to the bank dressed as a woman in a black burqa and put on latex gloves.

The late-night scene outside the bank in west suburban LaGrange unfolded like a bad Hollywood script, complete with a burqa-wearing bank robber, a suitcase full of cash, a getaway driver and an alleged plot to escape to a tropical island with the spoils, authorities say.

But according to federal charges unveiled in Chicago, this was no movie.

As FBI agents watched in the early morning hours Thursday, ATM technician Gildardo Lopez Jr. walked up to the Chase bank branch at 14 S. LaGrange Rd. disguised as a woman with a black burqa over his face, a walkie-talkie connected to ear buds and carrying a black suitcase, authorities said.

Lopez slipped on a pair of latex gloves and went inside the bank’s ATM vestibule. When he emerged 15 minutes later, authorities said, the suitcase was stuffed with $168,174 in cash.

“There’s a lot of money in there,” the complaint quoted Lopez as telling FBI agents who took him into custody. Later, while under arrest at the LaGrange police station, he called his older brother and was overheard by an agent saying, “Call Leo, I f----- up,” the charges alleged.

Authorities also arrested alleged getaway driver Douglas Pineda, a Transportation Security Administration airport screener who was sitting in a Toyota Sienna minivan parked a block from the bank. Officers found a walkie-talkie with ear buds attached on the front seat, the charges alleged. When asked what he was doing there, Pineda replied he was waiting for his friend “Gil” and then pointed him out as the person authorities had just arrested, according to the charges.

In court Friday, the 31-year-old roommates from Chicago’s Southwest Side looked sheepish as prosecutors sought to have them held in custody pending trial, arguing they posed a danger to the community. Noting neither had a previous criminal record, U.S. Magistrate Judge Sidney Schenkier allowed them to be confined at home and released them to the custody of their respective fathers.

Outside court, Lopez’s attorney, Steve Greenberg, scoffed at the government’s portrayal of the bungling alleged criminals as dangerous or sophisticated.

According to the charges, Lopez concocted the ill-fated scheme because he believed his job as an ATM technician for Garda Cash Logistics could be in jeopardy. On Tuesday, he told a coworker he’d noticed a lot of cash in the ATM at the Chase bank and asked the employee for an electronic key that would shut off the bank’s alarm system, the charges alleged. The coworker instead went to the FBI.

In order to gain access to the cash, Lopez also had instructed Pineda on how to call Garda dispatchers and ask for a one-time security code, according to the charges. He even wrote out a script for Pineda, with the words “Hello my name is” and “I work for Garda” along with an employee number. The script was later found in Pineda’s van.

At a meeting Wednesday night secretly recorded by his coworker, Lopez said his accomplice worked for the TSA and was going to help him escape to the Dominican Republic, where he often visited and planned to buy a house, according to the charges.

Lopez’s Facebook bio stated he’d worked for Garda since 2004. His profile contained a recent photo of him smoking a large Cohiba cigar -- a brand manufactured in the Dominican. Another depicted a Dominican beach with lounge chairs, umbrellas and girls in bikinis. The caption on the photo read: “F--- yesss!!!”