Time to put your cowboy hats on, folks! It's time for a country twangin' lick.
Be sure to use your bridge pickup to get a sharp, crisp sound for riffs like these. You can also try adding a hint of close delay to give your sound more texture.
The main things we need to concentrate on in this riff are the bends and the rests. Our 5th fret bends are going to raise up a 1/2 step and be very abrupt and short. We're going to implement a good amount of staccato while we play the bends and notes. Notice the many sixteenth note rests we have? Having those rests there force us to play the preceding notes in a short and concise manner, creating staccato.
Let's look at the short legato/sweeping run at the end of the first measure. We'll be playing 16th note triplets there, so that means we'll be playing six notes for that beat. You'll start on the 3rd fret B string, then pull off to the 1st fret. After that, we'll be doing a little bit of upstroke sweep picking until we get to the 3rd fret D string. Once your ring finger reaches the 3rd fret D string, you'll then pull off to the open string note, then hammer-on back on the 3rd fret note with your index finger. It's a little tricky, but keep practicing that part slowly and you'll get it. Watch out for unwanted string noise as well.
Happy twangin'!