I need help with this script, where are the errors?

I cant seem to find the errors in my script could someone point them out so I can fix them?

Code :

#pragma strict

var damageDelay = 3.0; 

var Spikes : boolean;

var Jab : AudioClip;

function Start () {

}

function Update () {

	if(InSpikes = true){
		yield WaitForSeconds(damageDelay);
			Health.HP = Health.HP - 1;
				audio.PlayOneShot(Jab);
	}
}


function OnTriggerEnter (){
InSpikes = true;
 
}

function OnTriggerExit (){
InSpikes = false;

}

In line 15 you should write:
if(InSpikes == true){ instead of if(InSpikes = true){
when you checking if something is true you should use ==
when you assign a value you use =
Daniel

You declared the variable as “Spikes” and then refer to it in the rest of the script as “InSpikes”.
It should be inSpikes, because variables should start with lowercase letters.

Also-

if (inSpikes)

does the same thing as saying

if (inSpikes == true)

and

if (!inSpikes)

does the same thing as

if (inSpikes == false)