When improvising any style of music there are a few main things that need to work together:
- Knowledge of fretboard/scales
- Groove/timing/feel/sense of rhythm
- Audiation (hearing something and then being able to play that on the bass)
Watch this video for more tips and lessons on how to develop and use these key areas.
Slap Bass Technique
If you're new to slap then watch this video which teaches a nice and easy slap exercise.
Here's another lesson on how to develop consistent slap technique.
There are more funk and slap lessons in my book 100 Funk Bass Grooves.
For slap bass, there are a number of scales you can use that will sound like your favourite bass lines. Among them are the Natural Minor, Dorian, and Minor Pentatonic scale. The latter is the one to really get down.
Here's F Minor Pentatonic across the neck. Download The Bass Guitar Resource book for free as all five shapes are outlined there.
Know any scale inside out in every direction on the neck and you will have complete freedom (provided your technique is up to scratch!).
You have to have a solid command of rhythm to be able to play interesting grooves in time with great feel.
Here's a good lesson on the basic rhythms you'll probably encounter.
There are more in the Groove section of the site.
Finally, your ear dictates the lines you learn and the lines that come out through your fingers via your brain. Work on these connections! Do this by memorising your scales and making sure you know the sound of the intervals that make up the scale. Learn patterns and link them to sounds.
Here's a good lesson on that vital skill.
Creating bass lines is easy when you have at least a passing knowledge of some of the skills mentioned in this post.
Here are a load more lessons which cover similar ground. I hope you get something from all these!