#pragma strict
var bullet : Rigidbody2D;
var force : float = 1500;
var damage : float = 100;
var reloadtime : float = 4;
var magcount : int = 10;
var magbulletcount : int = 21;
var bulletcount : int = 0;
function Start () {
bulletcount = magbulletcount;
}
function Update () {
if (Input.GetButtonDown(“Fire1”)&& bulletcount > 0){
var instance: Rigidbody2D = Instantiate(bullet, transform.position, transform.rotation) as Rigidbody2D;
var shoot: Rigidbody2D.AddForce(transform.right * force);
}
}