I think a first millennium point will have to be conceded to England’s 8th Century citations for the earliest record of football being played as I can find no reference earlier than the 9th Century for a Scottish “ba’ game”.
However for more modern history, Scotland’s claims to being one of the game’s original founders have more provenances.
The National Archive of Scotland and Scottish Archive Network make brief reference to Raith Rovers Football and Athletic Club being in existence as early as 1847, a separate body from the modern club which formed n 1873.
In 1824 John Hope organised a season of games for the “Foot-Ball Club” he had formed in Edinburgh. This club played until at least 1841.
Obviously these clubs must have had some opponents, against whom they could compete.
So robin, the Cambridge Rules drawn up in 1848, might be seen as a culmination whereby codification was achieved of a number of different rules sets that had evolved and were used by football teams in the preceding years. This does not necessarily mark the invention of association football, but is clearly a very significant step in football’s evolution and not least because this codification was adopted by Scotland