Shootin Worminator Like Game

Hi guys i am making a game similar to worminator. However my shooting script doesnt work in that my character doesnt even fire the bullet although movement works, can you have a look at it and see whats wrong.

var speed = 3.0;
var rotateSpeed = 3.0;
var bullitPrefab:Transform;
function Update ()
{
    var controller : CharacterController = GetComponent(CharacterController);
    transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
    var forward = transform.TransformDirection(Vector3.forward);
    var curSpeed = speed * Input.GetAxis ("Vertical");
    controller.SimpleMove(forward * curSpeed);
    var Bullet : Transform;
    function (
    (Input.GetButtonDown("Jump"))
    {
        Instantiate(Bullet,transform.position,Quaternion.identity);
        Bullet.rigidbody.AddForce(transform.forward * 1000);
    }    
}

Thanks

This should fix it:

var Bullet : Transform;
if (Input.GetButtonDown("Jump"))
{
    Bullet = Instantiate(bullitPrefab,transform.position,Quaternion.identity);
    Bullet.rigidbody.AddForce(transform.forward * 1000);
}

First change is that it needs to use if, not function, to check if the key is down

Second is that you need to assign the Instantiate to the Bullet prefab so you can use it after

Third is that you need to Instantiate bullitPrefab, not Bullet (which is completely empty still)

It doesnt seem to work :( firstly i see that it says expectin } found " on 17,1. Secondly do i need to change the word bullit prefab to my bullet and thirdly do i attach it to the actual character?

Mabye like so:

var speed = 3.0;
var rotateSpeed = 3.0;
var Bullet : Transform;

    function Update ()
    {
        var controller : CharacterController = GetComponent(CharacterController);
        transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
        var forward = transform.TransformDirection(Vector3.forward);
        var curSpeed = speed * Input.GetAxis ("Vertical");
        controller.SimpleMove(forward * curSpeed);

        if(Input.GetButtonDown("Fire1"))
        {
        Bullet = Instantiate(Bullet,transform.position,Quaternion.identity);
        Bullet.rigidbody.AddForce(transform.forward * 1000);    
        }

    }

Good old TornadoTwins, he is awesome ;)