When a robot is sent to the zoo to learn from King Julien the penguins believe they must capture and train the robot themselves.
King Julien awakes to find a box in his habitat. Believing it was a birthday gift from either Maurice or Mort, King Julien becomes angry when he is told that it's not theirs. A Lemur shaped robot emerges from the box and begins imitating everything King Julien does.
King Julien, believing this robot is a part of a prank orchestrated by the penguins, heads over to their habitat. Kowalski discovers online that the robot was made to emulate lemur behavior in preparation for a mission to mars and it is called the LEM-R (Life EMulating Robot).
King Julien is delighted at this and decides to teach the robot, who he has named "Lemmy", everything about being a king, including bossing, boasting and most importantly, dancing. The penguins believe that Julien should be teaching it how to defend itself. Mort, whom has become jealous of the robot getting all of King Julien's attention, offers to help the penguins steal Lemmy. During a game of hide-and-seek, the penguins steal Lemmy.
The penguins take Lemmy back to their habitat and try to teach him some "patented penguin moves", but Lemmy wants to go back to King Julien and dance. When Skipper pulls Lemmy back down the ladder, Lemmy identifies them as threats and round house kicks Skipper, much to Skipper's delight.
Meanwhile, Julien finds Mort, whom suspiciously says Julien will never see Lemmy ever again and that the penguins don't have him. Julien asks Mort if he knew where Lemmy was. Mort says he doesn't know then King Juien says he shouldn't mid if he tickles him and begins tickling Mort to get it out of him. Mort doesn't give in and likes being tickled.
The penguins all tackle Lemmy, causing him to malfunction and explode, making Mort finally tell Julien about Lemmy's whereabouts. King Julien sees Lemmy destroyed and is left devastated. He enters a severely deep state of depression and the penguins, feeling guilty and remorseful, rebuild the robot to make Julien feel better.
Lemmy eventually makes it to Mars but is ambushed by a space squid. Skipper remarks that they shouldn't send a lemur to do a penguin's job(He says "Now this is what happens when you let a lemur handle a space-bot").