Let $\mathbb{Z}$ and $\mathbb{Z}^{+}$ be the set of integers and the set of positive integers, respectively. For $a,b,c,d,n\in \mathbb{Z}^{+}$, let $t(a,b,c,d;n)$ be the number of representations of $n$ by $\frac{1}{2}ax(x+1)+\frac{1}{2}by(y+1)+\frac{1}{2}cz(z+1)+\frac{1}{2}dw(w+1)$ with $x,y,z,w\in \mathbb{Z}$. Using theta function identities we prove 13 transformation formulas for $t(a,b,c,d;n)$ and evaluate $t(2,3,3,8;n)$, $t(1,1,6,24;n)$ and $t(1,1,6,8;n)$.