function tweenCFrame(part,oldPos,newPos,Speed)
local XCal = newPos.X - oldPos.X
local YCal = newPos.Y - oldPos.Y
local ZCal = newPos.Z - oldPos.Z
for i = 1,((newPos.CFrame-oldPos.CFrame).magnitude) do
part.CFrame = CFrame.new( (xCal/Speed)*(i*(1/wait()) , (yCal/Speed)*(i*(1/wait()) , (zCal/Speed)*(i*(1/wait()) )
wait(Speed/wait())
end
end |