Taking ideas from other instruments and transferring them to guitar is a great way to broaden your playing style. It takes practice to develop this ability, but it is a good way to develop your ear as well as giving you lots of new ideas. Most of the great players have learned this way. For example, Buddy Guy’s classic double note licks came from ideas he heard Otis Spann play on the piano. BB King also learned from horn players as well as other guitarists. Example 106 is played first by the harmonica and then the guitar.
Once you can play the lick, try moving it to other places on the fretboard.
You could also try tranposing the lick up or down an octave.
Sometimes it is difficult to copy the lick exactly because of the different sound available on other instruments. Experiment with different techniques when imitating another instrument. One particular area of difficulty is rapidly repeated notes. Two important techniques to use in this situation are the tremolo and the trill.
This time the idea is taken from the piano. It’s an old Ray Charles lick. Notice the difference in character between the harmonica licks and this piano lick.
Again, once you have control of the lick experiment with different techniques. Bending notes isn’t possible on the piano, but Albert Collins made this lick sound great on the guitar by using bends.