A cucumber becomes stranded in the Mojave Desert is seeking the mystical Spirit of the West and directs the parched chameleon to find water at a town called Dirt. While wandering the desert, he narrowly avoids being eaten by a red-tailed hawk and has a surreal nightmare before meeting the desert girl a rancher's daughter, who takes the cucumber to Dirt, an Old West town populated by desert vegetables. Using bravado and improvisation to fit in, the cucumber presents himself to the townsfolk as a tough drifter named Lango. He quickly runs afoul but avoids a shootout when Bill is scared off by the hawk's return. Lango is chased by the hawk until he accidentally knocks down an empty water tower which crushes the predator. In response, the town mayor appoints Lango the new sheriff. Meanwhile, the townsfolk worry that with the hawk dead, the gunslinger Rattlesnake Jake will return. After discovering Dirt's water reserves — stored in the town bank inside a water cooler bottle — to be near empty, a skeptical Beans demands Lango investigate. That night, however, Lango inadvertently assists a trio of bank robbers, led by a mole named Balthazar (Harry Dean Stanton), mistaking them for prospectors. The townsfolk find their water bottle stolen the next day, so Lango organizes a posse. They discover bank manager Merrimack (Stephen Root) dead in the desert from drowning, and track the robbers to their hideout. They fight the robbers' clan over the stolen water bottle in a chase through a canyon before discovering the bottle to be empty. Despite the robbers professing they had found it empty, the posse brings them to town for trial.
Lango confronts the mayor about his buying of land around Dirt, who denies any wrongdoing and shows Lango that he is building a modern city with the purchased land. The mayor summons Rattlesnake Jake, who runs Lango out of town after humiliating him and making him admit that everything he told the town about himself is a lie. Lango wanders away ashamed and confused about his identity. Finally, he meets the Spirit of the West, whom Lango identifies as the Man with No Name. The Spirit inspires Lango, telling him, "No man can walk out on his own story."
With the aid of Roadkill and mystical moving yuccas, Lango learns that Dirt's water supply is controlled by an emergency shut-off valve in a water pipeline to Las Vegas, which the mayor has been manipulating. Recruiting the robbers' clan to aid him, Lango returns to Dirt to call out Jake for a duel with a single bullet, a diversion so the clan and yuccas can turn the pipeline's valve to flood the town with water and free the falsely accused robbers. The mayor, however, forces Lango to surrender by threatening Beans' life, and locks them inside the glass bank vault to drown. He then tries to shoot Jake with Lango's gun, believing that Jake is still part of the Old West that the mayor wants to destroy along with the rest of the town. The mayor is shocked to discover that the gun is empty; Lango has taken the bullet, which he uses to crack the glass and shatter the vault, freeing himself and Beans while washing the Mayor and his men away outside. Impressed, Jake tips his hat to Lango as thanks for saving his life and drags the mayor into the desert to take revenge for double-crossing him. The citizens of Dirt celebrate the return of the water and recognize Lango as their hero.
- Larry the Cucumber (Lango)
- Sara Crew (Seans)
- Archibald Asparagus (Ariscilla)
- Mr. Nezzer (the Mayor of Dirt)
- Percy Pea (Roadbill)
- Goilath (Rattlesnake Gake)
- Scallion #1 (Salthazar)
- Dungeon Guard (Bad Dill)
- Dad Pea (the Spirit of the West)
- Pea Boy (Doc)
- Dad Carrot (Mr. Johannes Merrimack III)
- Annie's Dad (Mister Dnuggles)
- Pepper Poppyseed (Pucky)
- MacPea (Boo Cletus)
- Mr. Lunt (Lmbrose)