function part(pos1, pos2)
local p = Instance.new("Part", Workspace)
p.Anchored = true
local mag = (pos2 - pos1).magnitude
p.Size = Vector3.new(1, mag, 1)
p.CFrame = (CFrame.new(pos1, pos2)) * CFrame.new(0, p.Size.Y / 2, 0)
return p
end
That code up there is supposed to create a part that stretches from one position to another, with one end on pos1, and the other end on pos2, It doesn't error, but for some reason, it starts at pos1, but doesn't end in pos2, it inverts it kind of, it's hard to explain. Does anybody know how i can fix that?

1 comment
Thank you sir!