AlKarva welcome.

And yes, I have also used dreams for writing music. It is really effective.
I once did this experiment where I would go to the cd store and pick out my album and listen to it in a dream, and amazing music came out of it, and I was just blown away.

The only problem was when I woke up the melody and chords were really hard to remember, but the potential is there. I am convinced it can help you write music, and it can really help with your creativity and answering questions and all sorts of stuff.