public void Upgrade(int turretnum) { NetPlayer.CmdDestroy(turret.GetComponent <NetworkIdentity>().netId); NetPlayer.CmdUpgrade(gameObject.GetComponent <NetworkIdentity>().netId, turretnum, GetBuildPosition()); Player.Money -= turretBlueprint.UpgradeCost; int NewCost = turretBlueprint.cost + turretBlueprint.UpgradeCost; turretBlueprint = new Blueprint(NewCost); }