Hayseed Egghead arrives in the big city of Bagdad and quickly wins a magic lamp in a carnival coin-operated crane game. The shady character who was playing the game before him covets the lamp, and tries to steal it. Egghead sees a poster: The sultan is having a contest for his daughter's hand in marriage. With his lamp, Egghead thinks he's a sure bet; he conjures up a magic carpet, and he's off. After a couple bad vaudeville acts, it's Egghead's turn, but in the meantime, the bad guy swapped the lamp for a coffeepot. Egghead is thrown out, then sees the bad guy using the lamp; Egghead breaks in, steals the lamp and the girl, and flies off. But she uses the lamp herself to conjure up a real hunk to replace the nerdy Egghead.