This solution is for 6 pairs of electron , try to grasp the concept
We need to use the VSEPR theory for the calculation of the value of x. Since there are six pair of electrons around the central metal ion, so the compound should be ML6 and the shape should be octahedral. But as mentioned in the question, the molecule is planar, This is possible if there are just 4 ligands around the central atom and there are two pair of electrons present as the lone pair of electrons. So the compound should have the formula as ML4 with the value of x as 4. The shape will be regular planar as the lone pairs will be present one on the top and the other on the bottom .