After my PhD supervisor left, I was assigned to a new PI who has little experience in my area
I don't understand why this sentence has the word "but":


  Once in a while X is talking to me through skype but now X seems to be mainly interested in authorship of the work we have done together and also a project we planned to do.


Without the "but," that would sound great!

In principle, your choices are:


Transfer to X's new institution
Stay where you are but continue collaborating remotely with X (with lots of email and some occasional phone calls and video conferences).
Allow yourself some travel to where X is for some in-person collaboration (this has to be done with consideration for X's schedule and preferences, of course).
Talk to the department head and ask for advice.
Talk to someone else in your department and ask for advice.


Another thing you can do is basically choose option 2 (and perhaps 3), but try to be more independent than before, so that you don't need to take up so much of X's time.  Here are a couple of tricks for doing that: 


Have a dialogue with X in your mind, where you lay out a question, and then you imagine the discussion that would ensue with X, based on what you know of X.  This works best when you're almost asleep.
Rubber duck your problem with a good listener, as programmers do when they're having trouble finding a bug.  Walk the listener through the background to your question, and the question itself.  Often, going through this careful exposition with a human being who at least looks like he's paying attention will get you unstuck.