i’m on school wifi so i’m unable to give the second solution to this currently, however the first one I can suggest is making a boolean variable for whether or not the mouse is held. on Button1Down or inputbegan/inputchanged set the variable to true. make your repeat loop’s base case until not button1Down have another function of inputended/inputchanged or Button1Up and set the variable to false
there is another solution that doesn’t require multiple functions but i do not have it memorized, i’ll add to this later when i am able to access my main computer.