Judges do not make the law, but interpret it, and apply it to cases. The law in Scotland is drawn from several sources.
Statutory law is legislation written by either the Scottish or UK parliaments or European legislation.
Common Law & Precedent
The common law is derived from Roman law, and from principles developed over centuries. It enables the treatment of cases to be consistent, but also adaptable.
The decisions of higher courts may form a precedent which lower courts must follow. Only in this sense, do judges contribute to making law.
Many of the principles of common law are drawn from the works of the institutional writers who wrote about Scots law in the 16th to 18th centuries.