Operator issue in "then" statment.

The code is supposed to instantiate the product when the player clicks and there’s enought gold, then remove some gold. (I’m a novice programer)

var Gold:int;

var product : Rigidbody;

function Update () {

Gold = 15;

if (Input.GetButtonDown("Fire1") && Gold > 10) {
	
	Instantiate(product, transform.position, transform.rotation);
	Gold--;
					
}

}

You are setting Gold = 15 every frame. The comparison to 10 will always be true. Move Gold=15 to a Start function.