Freeze Rigidbody

Hi,
I want to make a script so that i can freeze the X, Z rotation and the Z position.
But when I attach the script to my gameObject it won’t work.

Here is the script so far.

var target : Transform;
function Start () {
}
function Update () {

}
function OnTriggerEnter (col : Collider) {

if(col.gameObject.tag == "mijnobject") {
GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.FreezePositionX;
GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.FreezePositionY;
yield WaitForSeconds(0.1);
this.GetComponent.<ConstantForce>().force = Vector3.right * 60;
this.GetComponent.<Rigidbody>().useGravity = false;
GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.None;
GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.FreezePositionZ;
GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.FreezeRotationX.FreezeRotationZ;

		}
	}

You’re setting the constraint equal to different values sequentially. The “constraints” property is a flagged enum value (or bitmask), as such you have to combine the constraints into a single value using bit operations. For example when you want to set the constraint to freezing the position of both the X & Y axis, you can do this:

 GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionY;

Hopefully my example makes sense, if not definitely check out the provided link!