Stanley Yelnats had a family curse, and would always be in the wrong place at the wrong time. He was framed for stealing some shoes and was sent to Camp Green Lake for it.
Stanley's family was cursed because of his great, great, grandfather, Elya Yelnats. Madame Zeroni gave Elya a pig and he would carry it up a mountain, and in return he would do the same for Madame Zeroni but he didn't and the family was cursed.
Hector Zeroni(Zero) ran away from camp, and was sure to be dead, but not long after he left, Stanley did. Stanley found Zero in bad condition, and they decided to head up the mountain.
Stanley brought Zero up the mountain and sang the family song to him, lifting the curse. Afterward they decide to head back to Camp Green Lake to look for the family treasure, and they find it.
When they found the treasure the Warden tried to take it, but it turned out to be Stanley's. Soon, Stanley's lawyer came to get him, but he wouldn't leave Zero. Eventually, t hey got to Zero home, saving him.
Stanley's luck finally turned around, and he was now living a happy life with Zero. Camp Green Lake was shut down, Zero found his mom, and everything turned out good in the end.