This script emulate's the built in linbreak function's functionality. However, I added multiple sources to my script. With the built in function no matter what you pass as the argument for the source it will take close data. List of sources available are below:
close
open
high
low
ohlc4
(high+low)/2
(open+close)/2
(high+low+close)/3
Number of Lines parameter is configurable from 2 to 6.