Keep practicing and it will come, try learning a few songs that have simple lead parts in them so you can put those scales into practice, spend some time with the Jam Station here on guitar tricks so you can get more practice with improv guitar playing and maybe look into picking up a looper pedal if you think that will help or have a few jam sessions with a friend if you can.
Also check out these lessons by Chris
https://www.guitartricks.com/tutorial.php?input=483
https://www.guitartricks.com/tutorial.php?input=491
https://www.guitartricks.com/tutorial.php?input=2318
https://www.guitartricks.com/tutorial.php?input=2329