The Line tool is the incorrect tool to create this.
You should use the Polygon tool.
You can change the amount of sides by pressing the up and down arrown.
If it doesn't change the sides and starts duplicating - don't worry.
Press the Space Bar then press an arrow key up or down and it will change the amount of sides.