Criminal Justice (Scotland) Act 1980
The Criminal Justice (Scotland) Act 1980 was an Act of Parliament in the United Kingdom (which still legislated for Scotland at that time). It made many changes to the law in Scotland, but most notably Section 80 decriminalized private homosexual acts between two consenting adults (with an Age of consent of 21), bringing Scottish law in line with what had been enacted for England and Wales in the Sexual Offences Act 1967. A similar change for Northern Ireland did not come into effect until 1982.
"Subject to the provisions of this section, a homosexual act in private shall not be an offence provided that the parties consent thereto and have attained the age of twenty-one years." (§80:1)
http://www.legislation.gov.uk/ukpga/1980/62/contents/enacted Text of the Act as originally enacted.