How can I get what a function returned not on the same line?

So, I am making a drawing system and in oreder to see if 2 lines are touching each other at all to fill in the tiny gap between them I made a intersecting line function, but I need the last position that a frame was placed, here is where my issue comes in.

lastLinePositionX, lastLinePositionY = drawLine(lastMousePosition, input.Position, 2, lastLinePositionX, lastLinePositionY)

I am trying to return the positions that it placed it at so I can set it to my lastPositions but I can’t because I also need to send the positions on the same line, thanks in advance.

If I understand your issue correctly, you could do this:

local values = { drawLine(lastMousePosition, input.Position, 2, lastLinePositionX, lastLinePositionY) }

local value1 = values[1] -- first returned value
local value2 = values[2] -- second returned value

Is it not working? I don’t’ see the problem with how you’re doing it.