instance variable drawn=0
on click: save x and y in 2 variables, set drawn=1, call function "draw"
function "draw":
pick object drawn=0; pick random instance: draw line from saved x and y to sprite.x and y; save x and y coordinates in the variables again, call function "draw"
you can also do that in a while loop ofc, stop condition could be related to sprite.pickedcount = 0 after picking drawn=0 or you pick drawn=0 and repeat it pickedcount times.