We derive a continuous-time lace expansion for a broad class of self-interacting continuous-time random walks. Our expansion applies when the self-interaction is a sufficiently nice function of the local time of a continuous-time random walk. As a special case we obtain a continuous-time lace expansion for a class of spin systems that admit continuous-time random walk representations. We apply our lace expansion to the $n$-component $g|varphi|^4$ model on $mathbb{Z}^{d}$ when $n=1,2$, and prove that the critical Greens function $G_{ u_{c}}(x)$ is asymptotically a multiple of $|x|^{2-d}$ when $dgeq 5$ at weak coupling. As another application of our method we establish the analogous result for the lattice Edwards model at weak coupling.