I had the same problem and solved it in this:
function createLaserBetweenPoints(%vec1, %vec2, %thickness, %color)
{
%diff = vectorsub(%vec1, %vec2);
%norm = vectornormalize(%diff);
%laser = new StaticShape()
{
datablock = LaserBeamShape;
scale = vectorlen(%diff) * 5 SPC %thickness SPC %thickness;
position = vectoradd(%vec2, vectorscale(%diff, 0.5));
rotation = vectornormalize(vectorcross("1 0 0", %norm)) SPC mradtodeg(macos(vectordot("1 0 0", %norm))) * -1;
};
%laser.setnodecolor("ALL", vectornormalize(%color) SPC 0.5);
return %laser;
}
remove the stuff that you don't need and it should work