how I change this Js code for 2D

how I change this Js code for 2D

#pragma strict

var baritita : float;

var x : float;  
var y : float; 
var z : float;

function OnTriggerStay (other : Collider) {
    if (other.attachedRigidbody)
        other.attachedRigidbody.AddForce(Vector3(x, y, z) * baritita);
}

Delete z variable, and use a Vector2