Issue with breaking a loop


I want to break this loop whenever the MouseButton1 goes up but I have no idea how to do it.

Here ya can use UserInputService:IsKeyDown() like so

local UserInputService = game:GetService("UserInputService")
if not UserInputService:IsKeyDown(Enum.UserInputType.MouseButton1) then
    break
end