How to approach scales

Hi Mike, When I improvise, or play with others in a band setting and im asked to solo / jam or come up with a melody to something I always start with finding the key , and then playing the respective pentatonic scale over it. What I then do is listen to the music and...