well... long story, so let us get started!
in X-Y you can get meloetta by using poke-transporter from black-black2 NOT white-white2
in black-black2 you can only get it from the event so if you do not have 1 3ds, 1 dsi, Pokemon x/pokemon y, black/black2, poke-transporter, & wifi, then you will not be able to have a melloetta. sorry 'bout that.
trivia: meloetta's pokedex color is white