Scripting error: ';' expected. Insert a semicolon at the end.

This is my script that is getting the error message:


function (lightFire) {
    var campfire : GameObject = GameObject.Find ("campfire") ;
    var campSound : AudioSource = campfire.GetComponent (AudioSource) ;
        campSound.Play () ;

    var flames : GameObject = GameObject.Find ("FireSystem") ;
    var flameEmitter : ParticleEmitter = flames.GetComponent (ParticleEmitter) ;
        flameEmitter.emit = true ;

    var smoke : GameObject = GameObject.Find ("SmokeSystem") ;
    var smokeEmitter : ParticleEmitter = smoke.GetComponent (ParticleEmitter) ;
        smokeEmitter.emit = true ;

        Destroy (GameObject.Find ("matchGUI")) ;
}


The last line is the error line. I do not understand what is wrong with my code. There should not be a semi-colon there because it ends the statement, right? I am using the book, "Unity Game Development Essentials", by Will Goldstone, and I typed in the exact same thing that was in the book, but I am still getting the error. Please enlighten me.

Ah thanks I see what I did wrong, I should've seen it, but I must've skipped over it.

Your function name might be the problem. The name of the function should be out of the bracket

function lightFire()

sometimes when it says error ";" expected dosen't means that the problem is ";" so what is rong is at put function (lightFire), that totaly rong, the correct form is:

function lightFire(){}

If you want to put to repite this lots of times you may put:

function Update(){
lightFire();
}
function lightFire{}