Melee system problems

I get these codes as

(3,22) BCE0043 Unexpected token: =.

(7,20) BCE0043 Unexpected token: }.

(9.9) BCE0044 expecting :, found ‘Input’.

so I can not figure it out what to do, help me. here is my script:

#pragma strict

var TheDamage = int = 50;

var Distance : float;

var MaxDistance : float = 1.5;

function Update (}

{

  If Input.GetButtenDown("Fire1");

 {
  var hit : RaycastHit; 
  if (Physics.Raycast. (transform.Position, transform.TransformDirection : Vector3.Forward, hit));
Hit.Transform.sendmessage("ApplyDamage", TheDamage,SendMessageOptions.DontRecurieReciver);
       
    
  }

}

For starters…

First line should be
var TheDamage : int = 50;

delete “}” from “function Update (}”

“If Input.GetButtenDown(“Fire1”);” should be
if (Input.GetButtonDown (“Fire1”)) {

It looks like a lot of this code was just incorrectly copied from the Unity docs. I agree with the commentors that you need to do some general programming tutorials. If you are making these kinds of mistakes and unable to correct them there is no way you will be able to code a game. I’m not trying to be discouraging or anything but you will have a much easier time with this if you know basic programming concepts :smiley: