After pulling off one last big prank at Third Street Elementary School, T.J. Detweiler and his friends meets Tino and his friends and are excited about being done with the school year and starting summer vacation. But TJ's happiness is short-lived, as he finds out that all five of his best friends (and most of their schoolmates) are going to be gone for most of the summer at various summer camps around the state to plan for their futures. T.J. quickly becomes bored and lonely without his friends to hang out with, and even very reluctantly agrees to hang out with the school snitch Randall. On his way there, he notices something going on at the school. T.J. sneaks inside and finds scientists using a tractor beam to levitate a safe. Panicked, he tries to tell his parents and the police, but they do not listen. When he gets Principal Prickly to come to see what's going on, he is electrocuted and dematerialized just as he attempts to unlock and open the door, leaving only his shoes behind as evidence. T.J. is now frustrated because his parents and the police continue to ignore him. He decides he has to round up the gang and uses his sister Becky's diary to blackmail her into driving him to all the camps to pick up his friends.
T.J. and his friends steal a box of documents, but filled with no information. T.J's friends then accuse him of making up an idea just to bring them back. T.J. tells them he really did see Prickly disappear, but Gus points out that Prickly had just got into a car and driven off. The five are about to head back to their camps when they see the tractor beam come out of the school and shoot out a green laser, agreeing with T.J. that something strange is going on in the school. The gang have a stakeout at T.J.'s treehouse and enjoy eating snacks and singing a song Becky taught them the summer after they got done with Kindergarten. The next day, T.J. finds Prickly's golf pants in a dumpster and also sees the bald guy he saw guarding the school pull off a mask of Principal Prickly's face, showing that this was indeed him pretending to be Prickly when Gus pointed out the other Prickly getting into a car.
The gang finds a note in the pocket of Prickly's golf pants saying "HELP ME!" on it; this makes T.J. and his friends decide to break into the school to save him. Randall eavesdrops on this and informs the assistant teacher, Miss Finster, who then plans to catch the gang trying to break into the school. While there, they are caught spying by the guards (which includes a cadre of ninjas) and are forced to flee, an act witnessed by a shocked Randall and Finster, who then wonders what exactly is going on in the school. T.J., on the other hand, is captured and is put in a storage room where he finds the real Prickly, all tied up in thick ropes to a chair and his mouth gagged. The bald guy's boss turns out to be a man named Dr. Phillum Benedict, who enters the room to interrogate Prickly and T.J.
After Benedict leaves, Prickly reveals to T.J. that he and Benedict were once best friends and that Miss Finster used to be Benedict's girlfriend. Prickly then explains his story, back in the spring of 1968, Benedict became the principal of Third Street School. During a private conversation with Prickly, Benedict showed him that he had intended a move to abolish recess as a way to improve test grades. Needless to say, Benedict's plan didn't go well, as it was met with a protest of angry parents. Since Benedict refused the parents' demands to reinstate recess, Prickly went to the superintendent as a means of convincing Benedict to change his mind. Despite the superintendent assuring the parents that Benedict's no-recess policy will not be put into motion, Benedict refused to back down, which then caused the superintendent to demote him and promote Prickly to principal. Shocked, Benedict accuses Prickly of stealing his job, which then caused a disgusted Finster to break off her relationship with Benedict for this and his hatred of recess. Upset, Benedict ended his friendship with Prickly and quit his job as a teacher, swearing revenge on him. Later on, Prickly says Benedict went into politics and became Secretary of Education, only to be fired by the President when he tried to abolish recess nationwide.
Using the air ducts, T.J. and Prickly head to Prickly's office, where T.J. finds his walkie-talkie that Prickly had confiscated from him last week and tells his friends Benedict wants to destroy summer vacation after seeing painted graffiti on his wall, indicating so. However, T.J. and Prickly are caught by the bald guy again before T.J. could explain further. T.J.'s friends then try to get the police into the case, but just like T.J., they end up being laughed at. Even Finster tried to voice her objections over what's happening in the school, only for the policemen to laugh at her, much to her rage (saying they should contact Jackie Chan). T.J.'s friends go through the box of documents again. Spinelli finds a date book that says lunar perigee (which happens to be 12:22 the next afternoon) on it; Gretchen deduces that Benedict is trying to move the moon's orbit via tractor beam when it's closest to the Earth, which as a result, will create a new Ice Age. Benedict reveals to T.J. and Prickly that his ultimate plan is to put the world in an eternal state of winter so that kids will be forced inside to study year round.
T.J.'s friends get Becky to drive to the camps again, where they pick up all the children. Gus draws up the plans to attack the school. T.J. and Prickly escape the cage that Benedict has imprisoned them in, as Prickly swiped up the keys when Benedict wasn't even looking. Gus' plan works, and he, Vince, and Spinelli throw water balloons at the guards, causing them and the ninjas to chase the three of them through the school. Some of the guards chase Vince, but the Ashleys trip the guards with a rope and confine them in a net. Some other guards chase Gus, but the leaders of recess and the soldiers from his camp pummel them with balls. The ninjas chase Spinelli, but the kindergarteners attack them back. After reuniting with T.J. and Prickly, the kids storm the auditorium, only for another set of guards to restrain them as Benedict prepares to pull the lever. However, Finster arrives to the rescue, bringing the teachers and staff as an army to help stop Benedict for good. A battle ensues between Benedict's men and the students and staff. During the battle, the bald guy tries to attack T.J. in the face for bathing him in corn chowder, but Finster knocks him out for good. Prickly then punches Benedict in the face to stop him from triggering the beam, but as Benedict slumps, he triggers the beam and Prickly cannot deactivate it. T.J. tosses his old baseball (the one he found earlier while trying to recover his walkie-talkie) to Vince, whose accurate aim destroys the device, much to everyone's delight. Following the aftermath of the battle in the school, T.J. and his friends are declared heroes while Benedict and his men are captured by the police for theft, breaking and entering, and attempted terrorism.
T.J.'s friends inform him they intend to spend the rest of their summer with him, and T.J. gives Becky her diary back to thank her. T.J. then rushes into Prickly's office to thank him, only to be thanked back by Prickly for reminding him of why he went into teaching in the first place: to help kids. As T.J. starts to leave with his friends, Prickly warns him: "But don't forget- come September, you're mine! I haven't forgotten that "saggy butt" comment!". T.J. tells him September is a long way off. The film ends with T.J. and his friends rushing off to the lake whilst Prickly looks on, smiling.
- Ash Ketchum, Pikachu, Misty, Togepi, Brock and Team Rocket (Jessie, James, and Meowth) guest stars in this film.
- Team Rocket (Jessie, James, and Meowth) will work for Dr. Phillum Benedict.
- Part 1:
- Part 2:
- Part 3:
- Part 4:
- Part 5:
- Part 6:
- Part 7:
- Part 8:
- Part 9/Credits: