The film tells the fictional story of Nicholas Garrigan (James McAvoy), a young Scottish doctor who travels to Uganda and becomes the personal physician of President Idi Amin (Forest Whitaker). The film is based on events of Amin's rule, and the title comes from a reporter in a press conference who wishes to verify whether Amin, who was known to adopt fanciful imperial titles for himself, declared himself the King of Scotland. The film has an approval rating of 87 % at Rotten Tomatoes, and Whitaker won Best Actor at the Academy Awards, among others.

Answer this question based on the passage: who was the last king of scotland based on? OK. Let's think. My stream of consciousness:
The important part for answering this question is: The film is based on events of Amin's rule, and the title comes from a reporter in a press conference who wishes to verify whether Amin, who was known to adopt fanciful imperial titles for himself, declared himself the King of Scotland. The answer is President Idi Amin.