What is wrong with this shooting script?

I am creating a script that’ll make my gun shoot ready made bullets. I have an invisible spawnpoint infront of the gun. (FPS)

Here’s the script:

var BulletPrefab:Transform;
var force : float = 2000;

function Update ()
{if(Input.GetMouseButtonDown("Fire1"))

{var bullet = Instantiate(BulletPrefab,

GameObject.Find("spawnPoint").transform.position,

GameObject.Find("AK-47M").transform.rotation);

bullet.rigidbody.AddForce(bullet.transform.forward * force);


}
}

But I get the error message: Assets/FPSScripts/shoot.js(5,25): BCE0017: The best overload for the method ‘UnityEngine.Input.GetMouseButton(int)’ is not compatible with the argument list ‘(String)’.

And i don’t get how i should make it shoot when i press leftclick in my mouse. anyone willing to help?

The best overload for the method ‘UnityEngine.Input.GetMouseButton(int)’ is not compatible with the argument list ‘(String)’. means it needs an int value as a parameter like 0,1,2

Input.GetMouseButton(0) → leftClick

Input.GetMouseButton(1) → RightClick

Input.GetMouseButton(2) → MiddleClick

cheers

Now it stands: Assets/FPSSCRIPTS 1/Shootingscript.js(5,29): BCE0077: It is not possible to invoke an expression of type ‘boolean’.

why so many errors? :frowning: