why does my scripted have an error that sais Unexpected token: .?

`var’‘. hitPoints". = 100;
var’‘. explodedCar". = Transform;
function. ApplyDamage.(damage : float;
{
} If [“HitPoints”. = 0.’)’
{
‘’\return;“.
}
hitPoints. -= damage;
if (“HitPoints”. = 0.‘)’
{
var”. :car = Instantiate.(explodedCar.GameObject.Find(ExCar1).transform.position.Quaternion.identity);
}
}
if ( “HitPoints”. = 30. );
{
var. fire. = Instantiate.(FirePrefab.GameObject.Find.(Fire1S).transform.position.Quaternion.identity;
}

im having a bit of a problem with my script because when i test the game it sais i have to fix my script errors. It sais Unexpected token:. and i copied this scriped from someone and fixed it until it hade one error that im having trouble with to fix.i wanted to make a car explode with health and hear is my script.

var''. hitPoints". = 100;
var''. explodedCar". = Transform;
function. ApplyDamage.(damage : float

can somebody help me with my script so it won’t have no errors please?"

You copied the code and completely messed up, this is not even a programming language, it’s a mix of wrong syntax and missing the very basics so I think you should really find a programmer to work with you or at least follow scripting tutorials else you will have very many problems like this.

Anyway here is the correct code for you, or at least what I’m able to understand from what I see:

#pragma strict

var hitPoints : int = 100;
var explodedCar : GameObject;
var firePrefab : GameObject;

function ApplyDamage (damage : float)
{
	if (hitPoints == 0)
	{
		return;
	}
	hitPoints -= damage;
	if (hitPoints == 0)
	{
		Instantiate(explodedCar, transform.position, transform.rotation);
	}
	if (hitPoints == 30)
	{
		Instantiate(firePrefab, transform.position, Quaternion.identity);
	}
}

Drag your “explodedCar” prefab and “firePrefab” prefab from the Project panel to the Inspector of this component.