I have been having issues with my script and i cant seem to figure out the problem it keeps saying "BCE0044 Expecting EOF,found ‘{’. Heres my script its for a game im creating
var Bullet : Rigidbody;
var Spawn : Transform;
var BulletSpeed : float = 1000;
var ReloadTime : float = 2;
var AmmoInMag : float = 30;
static var ReloadTTime : float;
static var AmmoLeft = float;
static var CanFire = true;
var FireRate = 0.1;
static var IsReloading = false;
var idle : String;
var walk : String;
function Start (){
AmmoLeft = AmmoInMag;
ReloadTTime = ReloadTime;
}
function Update () {
if(AmmoLeft == 0)
{
Reload();
}
}
if(Input.GetButton("Fire1"))
if (AmmoLeft > 0){
BroadcastMessage("FireAnim");
}
}
function Fire(){
var bullet1 : Rigidbody = Instantiate(Bullet,Spawn.position,Spawn.rotation);
bullet1.AddForce(bullet1.transform.forward *BulletSpeed);
AmmoLeft -= 1;
audio.Play();
}