Gun Script help

I’m getting this error: Assets/Scripts/Gun.js(17,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.

And also this: Assets/Scripts/Gun.js(17,34): UCE0001: ‘;’ expected. Insert a semicolon at the end.

Idont understand what the problem is, can someone please help me?

and btw i know that the script isnt done yet :wink:

sorry for my bad english hope you understand

public enum GunType { FullAuto, SemiAuto, ShotGun, BurstFire }

var Sparks : Transform;

var NumberOfShots : int;
var damage : float;
var fireRate : float;
var spread : float;
var recoil : float;
var weight : float;
var type : GunType;
var magSize : int;
var ammo : int;


private var mag : int;
private var nextFire = 0.0;
private var SparksArray Transform[];

function Start () {
    SparksArray = new Transform[NumberOfShots];
	for(var i=0;i<SparksArray.Length;i++) {
	    SparksArray[i] = Instantiate(Sparks, Sparks.position, Sparks.rotation);
	}
}

function Update () {
    switch(type) {
	    case GunType.FullAuto :
		    if(Input.GetButton("Fire1")&Time.time > nextFire) {
			    nextFire = Time.time + fireRate;
				FireA();
			}
			break;
		case GunType.SemiAuto :
		    if(Input.GetButtonUp("Fire1")&Time.time > nextFire) {
			    nextFire = Time.time + fireRate;
				FireA();
			}
			break;
		case GunType.ShotGun :
		    if(Input.GetButtonUp("Fire1")&Time.time > nextFire) {
			    nextFire = Time.time + fireRate;
				FireS();
			}
			break;
	}

}

function FireS () {
    for(var i=0;i<SparksArray.Length;i++) { 
        var hit : RaycastHit;
	    var BulletDirection = transform.TransformDirection(new Vector3(Random.Range(-spread,spread)*0.002,Random.Range(-spread,spread)*0.001,1));	
	    
		if(Physics.Raycast(transform.position, BulletDirection, hit, Mathf.Infinity)) {
	        if(hit.transform.gameObject.tag=="Player")
		        hit.transform.SendMessage("M_Damage", damage);
		    SparksArray[i].position = hit.point;
	    }
		
    }
	
	mag--;
}

function FireA () {
    var hit : RaycastHit;
	var BulletDirection = transform.TransformDirection(new Vector3(Random.Range(-spread,spread)*0.002,Random.Range(-spread,spread)*0.001,1));	
	if(Physics.Raycast(transform.position, BulletDirection, hit, Mathf.Infinity)) {
	    if(hit.transform.gameObject.tag=="Player")
		    hit.transform.SendMessage("M_Damage", damage);
		Sparks.position = hit.point;
	}
	
	mag--;
}

It would be easier for people to help if you posted the code straight to the forum with Code Tags so we don’t have to download a file.

Sorry , have fixed it now :wink: