One morning, the Rescue Rangers get up to find the living room strewn with litter. Since Dale was the one who made the mess, Monty and Chip decide he should clear it up.
Outside, Dale grumbles to himself as he lugs a sack of garbage to one of the park's litter bins. He then slips and falls into the bin as Chip (watching from a nearby tree) laughs at him. But, moments later, the garbage man comes to empty the bin and Chip is unable to get down to the ground in time to rescue his friend.
Chip tells the other Rangers what has happened (this takes place off-screen) and they follow the garbage truck in one of Gadget's vehicles. Weaving in and out of traffic, they eventually end up flying through the air and landing in the back of the garbage truck. Soon, they are on a garbage barge and being towed out to sea. Chip says they will have to hitch a ride home when they reach the dump.
Dale, using a bottle as a lookout post, sees the dump in the distance. He then accidentally knocks a can down the mountain of garbage as Chip warns him to be careful. Moments later, Dale slips and is struggling to climb out of the bottle when it falls, with Chip directly in its path. Both chipmunks end up stuck in the bottle and Monty is about to smash it with a hammer in order to free them when Gadget spots something.
That something proves to be a floating barrel with an upside down skull-and-crossbones flag attached to the mast. Moments later, someone fires a net from the barrel and scoops up a load of garbage. Monty, Gadget and Zipper manage to avoid the net, falling overboard in the process, but Chip and Dale are dragged under the ocean. Luckily, Gadget says there should be enough air trapped in the bottle to keep them alive for a short while. Then, as the garbage barge sails away, Monty realizes he, Gadget, and Zipper will have to go down after the chipmunks.
Underwater, Chip and Dale try to propel the bottle back to the surface, only to be chased by an octopus named (we soon learn) Billy the Squid. They evade Billy and soon find themselves on a sunken ship, home to the band of rat pirates who call themselves the Pi-Rats. The Pi-Rats are led by their First Mate, Jolly Roger, and he invites the chipmunks to join them for a feast to celebrate the raid; the Pi-Rats were the ones behind the floating barrel. Afterwards, 'Arvey (the Second Mate) proposes a treasure hunt.
Dale has become caught up in the Pi-Rats' way of life and hurries to join them, ignoring Chip when he tells him they have more important things to do. Reluctantly, Chip joins the treasure hunt (which Dale has been chosen to lead) and the trail leads to a room filled with gold coins and other treasures. Jolly Roger then reveals that the Pi-Rats have treasure hunts every week so the gold must stay where it is. What is more, since Chip and Dale have seen the treasure, they must now remain under the ocean for life.
Meanwhile, the other Rangers head under the ocean in a submarine Gadget has built and quickly discover the sunken ship. Just then, their baking soda fuel runs out and they find themselves floating up into the ship, where Billy grabs the submarine. The Rangers escape as Billy smashes the submarine to pieces and eventually surface in the treasure room. There, Monty and Gadget are so busy looking at the treasure that they fail to notice that Billy is still after them. But Zipper spots one of the octopus's tentacles and warns the two mice.
Gadget lures Billy towards a treasure chest and, as his tentacle reaches into the chest, she snatches away the prop which is holding the chest open. This causes the lid to slam down on Billy's tentacle and, as he retreats, Gadget slides down the pile of gold to join Monty and Zipper. She tells the pair to look for the chipmunks while she works on building another submarine.
Elsewhere on the ship, the Pi-Rats have locked Chip and Dale in a cage to make sure they don't try to steal the treasure. Jolly Roger tells them that the Pi-Rats are awaiting the return of Captain Lafitte, who told them to guard the treasure. Monty, overhearing, disguises himself as a Pi-Rat and tells the crew that he is Lafitte and that Zipper is his "parrot". Convinced that Monty is their long lost Captain, the Pi-Rats set Chip and Dale free. Moments later, Zipper returns with Gadget, who doesn't know what is going on and almost slips up by addressing Monty by his real name. Luckily, Chip shuts her up just in time.
The Rangers prepare to board the barrel, which they will use to get back to the surface. But the whole escape plan goes awry when Lafitte's former cabin boy, Young Ned (who isn't quite so young anymore) appears with a plate of cheese which he has been saving for the Captain's return. As Monty rushes towards the cheese, he loses his disguise and Jolly Roger realizes he and the other Pi-Rats have been tricked.
Thinking the Rangers plan to steal the treasure, the Pi-Rats capture them and sentence them to walk the plank. The "plank" is actually a human-size cutlass, which juts out over Billy's lair - and the octopus is hungry. Then, just as the Rangers reach the end of the "plank", Zipper breaks free, prompting Jolly Roger to strike the "plank" with his sword, causing the Rangers to fall. Monty holds onto the "plank" with his tail as Billy grabs the Rangers.
Zipper flies at Billy and makes him sneeze. This sends the Rangers flying as the "plank" cuts them free. Moments later, the Pi-Rats spot them clinging to a rope which, when pulled, sends a load of food cascading down on Billy as the Rangers climb into the Pi-Rats' larder. There, Gadget suggests that they try to refloat the ship; her theory is that the weight of the treasure is holding it down so they will have to unload it somehow.
The Pi-Rats give chase and, as Monty and Zipper battle them, Gadget and the chipmunks load one of the human-size cannons, which they will use to blast the treasure free. Once the cannon is loaded, Gadget lights the fuse and the cannonball goes zooming through the ship, sending the treasure cascading into the ocean. Freed from the extra weight, the ship floats to the surface and Gadget tells the Pi-Rats that, from now on, they will be able to live above the water like other rats. Best of all, Chip and Dale have captured Billy and tied him to the crow's nest by his tentacles.
The Pi-Rats set off in search of adventure, while the Rangers head home in the barrel. Before they part, Dale gives them a farewell cannon salute - of garbage.