In Star Wars, C-3PO is introduced to the audience when C-3PO and R2-D2 are aboard the consular ship Tantive IV when it is attacked by Darth Vader’s Star Destroyer Devastator. When R2-D2 leaves the ship to deliver a secret message to Obi-Wan Kenobi, C-3PO follows R2-D2, eventually to the planet Tatooine. There, C-3PO and R2-D2 are captured by Jawas and taken to be sold. In the process of being sold to Owen Lars, C-3PO convinces his new owner to buy R2-D2 as well.
Throughout the film C-3PO is a foil to R2-D2's jokes, even when C-3PO translates R2-D2's machine speech for the audience. C-3PO was the property of the captain on the Tantive IV, but seems to follow R2-D2 in a relationship akin to those between human children; C-3PO often following R2-D2 around, and R2-D2 needing C-3PO to translate for him. When R2 is damaged in the Battle of Yavin, C-3PO offers to donate any mechanical parts helpful in his repair; but this transference is never confirmed.
In The Empire Strikes Back, C-3PO is responsible for identifying the Empire's probe droid, alerting the Rebels to the Empire's awareness of their location on the 6th planet of the Hoth System. C-3PO escapes with Han Solo, Chewbacca and Princess Leia in the Millennium Falcon, while R2-D2 joins Luke in his search for Yoda. During this time C-3PO and Solo are often shown as foils; C-3PO quoting odds and Han defying them. After a chase through the Hoth asteroid field, the Falcon escapes to the CloudCityon Bespin.
While exploring a room in CloudCity, C-3PO is blasted by an off-camera stormtrooper. In search of Threepio, Chewbacca heads to the Ugnaught recycling facility where he finds the dismembered parts of the droid. When Darth Vader reveals his presence to the group that same day, Chewbacca is sent into a holding cell, but is permitted to rebuild the droid, which he does poorly. Thereafter, Chewbacca carries the partially rebuilt C-3PO on his back during Han Solo's encasement in carbonite.
With the help of the city's administrator, Lando Calrissian, Princess Leia, Chewbacca and C-3PO escape the city. Having C-3PO on Chewbacca's back proves to be beneficial, in that when Boba Fett escapes the city with Han Solo, C-3PO notifies them of pursuing stormtroopers. After successfully escaping Vader's flagship Executor, C-3PO is fully repaired by R2-D2.
In Return of the Jedi, Luke commands C-3PO and R2-D2 to deliver a message to Jabba the Hutt, whereby C-3PO is used as Jabba's translator while R2-D2 serves on his flying “sail barge.” C-3PO's first translation for the crime lord is of the bounty hunter Boushh — Leia in disguise — claiming the bounty for Chewbacca. Later, Luke infiltrates the palace and kills Jabba's rancor in a duel, whereupon Jabba transfers his court to the sail barge with Luke Skywalker, Han Solo and Chewbacca as food for the Sarlacc, while Leia serves as Jabba's slave.
When Luke attempts escape, R2-D2 tosses him his lightsaber, with which he attacks Jabba's guards. In the midst of the battle, C-3PO is attacked by Salacious Crumb, who pulls out his right photoreceptor before being driven off by R2-D2. Thereafter the two escape the sail barge and are retrieved by the protagonists. C-3PO accompanies the strike force to the Forest Moon of Endor to disable the shield generator protecting the second Death Star.
When he, Han Solo, Luke, Chewbacca and R2-D2 are captured by the Ewoks, C-3PO is perceived to be a god by the latter. When the human prisoners are threatened by the Ewoks, Luke levitates the droid above the crowd as demonstration of the supposed god's ability, so as to prompt release. Later that night, C-3PO narrates the history and intentions of the Rebels to the tribe, convincing them to help the Rebels at the Battle of Endor.
It will be curious to see what role C-3PO (and R2-D2!) plays in Episode