When improvising any style of music there are a few main things that need to work together:
- Technique
- 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.
Fretboard Knowledge/Scales
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!).
Groove
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!
As always thank you Dan,I have been practicing my slap and this comes in my email.If I may suggest a lesson, I’d like to improve my slap rhythm but from a drum standpoint.How to create drum breaks by slapping the bass when melody is secondary and incorporating ghost notes,palm slaps ect.to achieve these drumming beat rhythms.If I’m asking you to go over ground previously covered please pardon me and perhaps direct me to the lessons.Thanks!
Thanks Kevin! I’m actually writing a book right now that has a few drum/slap grooves in it. It is a great way to practise… Send me an email and I’ll send the exercises. A video could be good too…