You can do it with a sprite that has it's origin at the left-center. It's height is the thickness and if you make it global it will survive till the next layout. The events to draw it is below. You can also create a circle sprite at the mouse to make the line look better at angles. You then can make the created objects solid or something.
global number oldx=0
global number oldy=0
on left click
--- set oldx to mouse.x
--- set oldy to mouse.y
left mouse is down
--- create sprite at (mouse.x, mouse.y)
--- sprite: set angle toward (oldx,oldy)
--- sprite: set width to distace(self.x,self.y,oldx,oldy)
Thanks for the response R0j0. see i had something like this before and the problem I get from it is that it is not a straight line it looks like this:
Like its attached to an origin