I Made a Revolver Script, But It's Saying There is an Error

I made a script, but it keeps saying I have an error on line 20. Here’s the error it has: Assets/Revolver Script.js(20,14): BCE0043: Unexpected token: … .I can’t figure out what’s wrong with it. Here is the line: var AmmoCount.GetComponent;

Edit
Shooting part not by me, but the ammo count and stuff like that are by me.
Shooting script link:http://www.unity3dmax.comxa.com/ShootScript.html
Here is the script (sorry about that): `//the bullet we are shooting must have a rigidbody
var Bullet : Transform;
//the speed the bullet is shot at
var Speed = 16000;
//where the bullet spawns (most likely the tip of the gun)
var spawnPoint : Transform;
//if we shoot like a machinegun or not
var RapidFire = false;
//if we shoot every click or not
var SingleFire = true;
//this is only used if rapid fire is set to true
private var shooting = false;
//RateOfFire private
var Counter = Time.deltaTime;
var RateOfFire = 0.250000;

var AmmoCount = 6;

function Update () {
var AmmoCount.GetComponent;
if button.down.(“shoot”);
if AmmoCount > 0;
getComponent.AmmoCount - 1;
//if single fire is set to true
if(SingleFire==true){
//we are using the left mouse button to shoot
if(Input.GetButtonUp(“shoot”)){
//we create the bullet
var shot =Instantiate(Bullet, spawnPoint.transform.position, Quaternion.identity);
//we add the speed
shot.rigidbody.AddForce(transform.forward * Speed); } }
if(RapidFire ==true){
if(Input.GetButtonDown(“shoot”)){
shooting=true;
}
if(Input.GetButtonUp(“shoot”)){
shooting=false;
}
if(shooting==true){ Counter += Time.deltaTime;
if(RateOfFire
<
Counter){
var shotRapid =Instantiate(Bullet, spawnPoint.transform.position,
Quaternion.identity);
//we add the speed
shotRapid.rigidbody.AddForce(transform.forward * Speed);
Counter=0; } } } }
else if AmmoCount < = 0;
void;
if button.down.(“reload”);
if AmmoCount = 0;
getComponent.AmmoCount + 1;
//Reloading Animation 1"
else if AmmoCount = 1;
getComponent.AmmoCount + 1;
//Reloading Animation 2"
else if AmmoCount = 2;
getComponent.AmmoCount + 1;
//Reloading Animation 3"
else if AmmoCount = 3;
getComponent.AmmoCount + 1;
//Reloading Animation 4"
else if AmmoCount = 4;
getComponent.AmmoCount + 1;
//Reloading Animation 5"
else if AmmoCount = 5;
getComponent.AmmoCount + 1;
//Reloading Animation 6"
else if AmmoCount = 6;
getComponent.AmmoCount + 1;
//Reloading Animation 7"
}
}
}
}`
If you tell me how, I will try to straighten it. If not, here is an image: [10190-revolver+script.png|10190]

You didn’t post the code, but with my minimal knowledge of compilers that means you didn’t use the right syntax or symbol. You posted AmmoCount.GetComponent;. That should be phrased:

AmmoCount.GetComponent(The Component you want to get);

Variable names can’t contain periods.

I think you wanted something like:

var ComponentName componentVariable = AmmoCount.GetComponent(ComponentName);

Except that “AmmoCount” can’t be right either because you made it an int above that.

Did you want to use the Transform object to get the component? (common)