Hello
I have a script that deals with buying a car. Here it is
#pragma strict
var NotEnoughMoney : GUIText;
var YouBoughtTheCar : GUIText;
function Start () {
Career_Variables = GameObject.Find("career_Variables").GetComponent<Career_Variables>();
Car_Variables = GameObject.Find("SpawningCarsPlane").GetComponent<ChooseCar1>();
}
function Update () {
if (Input.GetKeyDown(KeyCode.B))
{
if (Career_Variables.money >= Career_Variables.Price && carSelected == 0 && Car0Bought == false)
{
Career_Variables.money = Career_Variables.money - 7500;
Car_Variables.Car0Bought = true;
}
else if (Career_Variables.money <= 7500 && carSelected == 0)
{
Car_Variables.Car0Bought - false;
}
}
}
function BuyCar ()
{
if (Career_Variables.money >= Car_Variables.Price && Car_Variables.CarSelected == 0 && !)
{
if (Car_Variables.CarSelected == 0)
{
Career_Variables.money = Career_Variables.money - Career_Variables.Price;
PlayerPrefs.SetInt("Player Score", 10);
}
}
}
I get 9 errors such as BCE0043: Unexpected token: ). BCE0044: expecting ), found ‘;’. UCE0001: ‘;’ expected. Insert a semicolon at the end. etc.
Ive been stuck on this for some time. Any help would be fantastic.
Thanks in advance