  The purpose of this paper is to introduce twisted $\mathcal{O}$-operators on
$3$-Lie algebras. We define a cohomology of a twisted $\mathcal{O}$-operator
$T$ as the Chevalley-Eilenberg cohomology of a certain $3$-Lie algebra induced
by $T$ with coefficients in a suitable representation. Then we consider
infinitesimal and formal deformations of twisted $\mathcal{O}$-operators from
cohomological points of view. Furthermore, we introduce and study
$3$-NS-Lie-algebras as the underlying structure of twisted
$\mathcal{O}$-operators on $3$-Lie algebras. Finally, we investigate twisted
$\mathcal{O}$-operators on $3$-Lie algebras induced by Lie algebras.
