In Gathmann's notes on algebraic geometry (https://www.mathematik.uni-kl.de/~gathmann/class/alggeom-2002/alggeom-2002.pdf), he remarks in Lemma 6.1.4. (page 93) that the length of a zero-dimensional projective subscheme of $\mathbb{P}^n$ can be viewed as the number of points in $X$ counted with "scheme-theoretic multiplicity" (he also defines it as follows: $X$ is affine and is equal to $\textrm{Spec}R$ for some $k$-algebra $R$, and we can then say the length is just the dimension of $R$ as a $k$-vector space).
What exactly does he mean by scheme-theoretic multiplicity?
(He later defines divisors associated to a projective subscheme $Z$ of $\mathbb{P}^n$ on page 101 as $(Z)=\sum_i a_iP_i$, where $a_i$ are the scheme-theoretic multiplicities of $P_i\in Z$, i.e. "the length of the component of $Z$ at $P_i$," but I don't quite understand what this means either.)