Sorry, there is a typo in my previous reply, in which I mentioned the increasing of lattice vector b for a vacuum layer. It should be lattice vector c.
For the coordinates of atoms in the primitive unit cell of bulk 2H-MoS2, they can be referred to the paper:
Ricardo Grau-Crespo and Rafael Lo´pez-Cordero, Phys. Chem. Chem. Phys., 2002, 4, 4078–4079.
The attached scripts for the bulk configuration of 2H-MoS2 and n-layers of MoS2 (n=1, 2, 3, 4) are constructed according to the atomic coordinates listed on the Table 1 of the above paper. The experimental lattice constants of 2H-MoS2(a = 3.16 angstrom, c = 12.296 angstrom) are used.