At the beginning of Toy Story, One-Eyed Bart and his attack dog with a built-in force field (played by Mr. Potato Head and Slinky Dog) are seen robbing a bank in Andy's room only to be stopped by Sheriff Woody and Rex, who is playing the role of Woody's dinosaur who eats force field dogs.
Toy Story 3
At the beginning of Toy Story 3, The attack dog with a built-in force field (again played by Slinky) arrives to protect One-Eyed Bart (again played by Mr. Potato Head), One-Eyed Betty and their alien henchmen (played by Mrs. Potato Head and the Aliens) against the team of Woody, Buzz Lightyear and Jessie. However Jessie summons Woody's dinosaur who eats force field dogs (again played by Rex) to help them. Once Rex arrives to help Woody, Buzz and Jessie arrest Bart and his gang, the Evil Dr. Porkchop (played by Hamm) arrives. Porkchop then teleports One-Eyed Bart, the attack dog, One-Eyed Betty and the Alien Henchmen up to his ship.