Enlightened by the idea of purification through Zeno-like measurements (Nakazato et al 2003 Phys. Rev. Lett. 90 060401), we propose a scheme for generating three- and four-qubit decoherence-free states with respect to collective amplitude damping. The whole system is in a star configuration of a spin network and the outer spin qubits construct the decoherence-free state via measuring the state of central spin qubit at intervals of τ repeatedly. An interesting feature is found: namely, that in order to prepare the three-qubit decoherence-free state successfully, the value of τ for the projected time-evolution operator must be set definitely, while this restrictive condition is relaxed for achieving the four-qubit decoherence-free state. The simulation results reveal that the fidelity approaches one asymptotically, and the corresponding success probability reaches a stable value by increasing the number of measurements N.