Jumanji

In 1869, near Brantford, New Hampshire, two brothers named Caleb and Benjamin bury a chest, hoping that no one will ever find it. One hundred years later in 1969, 12-year-old Alan Parrish visits a shoe factory owned by his father, Samuel. He visits his friend Carl Bentley, an employee, who reveals a new shoe prototype he made by himself. Alan misplaces the shoe and damages an important machine, but Carl takes responsibility and loses his job. After being attacked by several bullies, who also steal his bicycle, Alan follows the sound of tribal drumbeats to a construction site. He finds the chest containing a board game called Jumanji, and brings it home.
At home, after an argument with Samuel about attending a boarding school, Alan plans to run away. Sarah Whittle, his friend, arrives to return his bicycle, and they begin playing Jumanji. With each roll of the dice, the player piece moves by itself and a cryptic message describing the roll's outcome appears in the crystal ball at the center of the board. Sarah rolls the dice but nothing happens. Alan rolls the dice; a message tells him to wait in a jungle until someone rolls 5 or 8, and he is sucked into the game. Afterwards, a swarm of bats appears and chases Sarah out of the mansion.
Twenty-six years later, Judy and Peter Shepherd move into the vacant Parrish house with their aunt Nora, their parents having died in an accident on a ski trip in Canada. The next day Judy and Peter find Jumanji in the attic and begin playing it. Their rolls summon giant mosquitoes and a group of monkeys. The game rules state that everything will be restored when the game ends, so they continue playing. Peter's next roll releases a lion and an adult Alan, who rushes to his father's factory. On the way, he meets Carl, who is now working as a police officer. In the now-abandoned factory, a homeless man tells Alan that after his disappearance, Sam abandoned the business and searched for his son, until his death four years earlier. The factory's closure has devastated the town's economy.
Realizing that they need Sarah to finish the game, the three locate Sarah â now suffering mental trauma from Jumanji and Alan's disappearance â and persuade her to join them. Sarah's move releases fast-growing man-eating vines, and Alan's next roll releases a big game hunter named Van Pelt, who has been hunting Alan in the jungle. The next roll summons a herd of various animals, causing a stampede, and a pelican steals the game. Peter retrieves it, but Alan is arrested by Carl, and Van Pelt steals the game. Peter, Sarah, and Judy track Van Pelt to a department store where they set booby traps to deter him and retrieve the game, while Alan escapes from Carl's car. When the four return to the mansion â now completely overrun by jungle wildlife â they release one calamity after another, until an earthquake destroys the mansion. As Van Pelt corners Alan and prepares to kill him, Alan finally makes the winning roll, causing everything that happened as a result of the game to be reversed.
Back in 1969, Alan and Sarah are children once again, but have full memories of the game's events. Alan reconciles with his father and admits that he damaged the factory's machine. Carl is rehired, and Sam tells his son that he does not have to attend boarding school. Alan and Sarah throw Jumanji into a river, then share a kiss.
In the present, Alan has taken over his father's business. Alan and Sarah are married and expecting their first child. They meet Judy, Peter, and their parents Jim and Martha for the first time at a Christmas party. Alan offers Jim a job, and convinces them to cancel their upcoming ski trip, averting their deaths.
On a beach in France, two young girls hear drumbeats while walking, as Jumanji lies buried in the sand.

Question: How long must Alan wait in the jungle?
Answer: Until someone rolls 5 or 8