![Ian McKellen](https://static-ssl.businessinsider.com/image/55ad553b2acae7a6098b80f3-4049-2025/gettyimages-480702320.jpg)
Getty Images
Ian McKellen has starred in a few of the biggest film franchises of all time.
It turns out he was very close to not getting either of those roles.
During this time, McKellen was also offered a role opposite Tom Cruise in "Mission: Impossible II."
![X-Men Magneto](https://static-ssl.businessinsider.com/image/55ad564a371d22a10e8b7dcf-1600-800/screen shot 2015-07-20 at 4.11.53 pm.png)
20th Century Fox via YouTube
McKellen as Magneto in "X-Men."
"I got offered a part in 'Mission: Impossible II' with $4, but they wouldn't let me see the whole script because I might have spilled the beans. I only got my scenes." $4.
However, McKellen didn't want to say yes to a project without knowing the whole story first.
"I couldn't judge from reading just those scenes what the script was like. So I said no. And my agent said, 'You cant say no to working with Tom Cruise!' and I said, 'I think I will.'" McKellen said.
According to McKellen, "X-Men" director Bryan Singer asked him to play Magneto the next day, to which he said yes. Not long after, director Peter Jackson asked Mckellen to play the wizard Gandalf.
![Gandalf](https://static-ssl.businessinsider.com/image/55ad572a2acae717448b5b49-1590-795/gandalf.jpg)
New Line Cinema via YouTube
McKellen as Gandalf in "The Fellowship of the Ring."
McKellen's chance to play Gandalf was almost put in jeopardy, as filming for "X-Men" ran way over schedule. He made it to New Zealand just on time to film "The Fellowship of the Ring."
However, he never made it to "Mission: Impossible II." And maybe that was for the better.
"Meanwhile, 'Mission: Impossible' was put off, put off, put off," said McKellen. "If I had decided to do that, I wouldn't have been in 'X-Men' and I wouldn't have been in 'Lord of the Rings.' It's all about luck - being there at the right time and ready for it."