An instance of type UnityEngine.X is required to access non static member 'Y'.

I get this error: Assets/Texture Autotile.js(5,22): BCE0020: An instance of type ‘UnityEngine.BoxCollider’ is required to access non static member ‘size’.

from this code:

RequireComponent.BoxCollider();
var mat : UnityEngine.Material;
var materialscale : Vector3;
function Start() {
	(BoxCollider.size.z/19) = mat.material.mainTextureScale;
}

My script is trying to automatically tile a texture onto an object depending on the size. What’s Wrong!?

You can’t just put BoxCollider.size like that. You first need to tell Unity which BoxCollider to use. It won’t just look for the BoxCollider on that object without you telling it to.

var bc : BoxCollider;

function Start () {
  bc = GetComponent(BoxCollider);
  bc.size.z/19 = mat.material.mainTextureScale;
}

There are several wrong things here!

RequireComponent.BoxCollider(); // should be @script RequireComponent(BoxCollider);!
var mat : UnityEngine.Material;
var materialscale : Vector3;

function Start() {
  // you definitely can't assign to an expression! 
  (BoxCollider.size.z/19) = mat.material.mainTextureScale;
}

But this particular error message tells that you need a BoxCollider instance: since the object property collider is a Collider, you must assign it to a BoxCollider variable in order to access its properties - like this:

function Start(){
  var box: BoxCollider = collider; // assign the collider to a BoxCollider variable
  box.size.z = some value
}