How to change pixel inset of GUITexture?

So when my health goes down I want the guiTexture to scale down in the x value just like a health bar. But I get errors when I try to get this to work. Can I keep it this way or do I have to change it?

Assets/Adventure Game/MaleCharacterPack/VincentSword_Control.cs(21,39): error CS1612: Cannot modify a value type return value of `UnityEngine.GUITexture.pixelInset’. Consider storing the value in a temporary variable

using UnityEngine;
using System.Collections;

public class VincentSword_Control : MonoBehaviour {

public int health;
public GameObject healthTexture;
private bool isHit;
private bool canPickupHealth;
private bool isDead;
// Use this for initialization
void Start () {
	health = 100;
	isHit = false;
	isDead = false;
}

// Update is called once per frame
void Update () {
	if(health == 100){
	healthTexture.pixelInset.x = 200.0f;
	}if(health == 95){
	healthTexture.pixelInset.x = 190.0f;
	}if(health == 90){
	healthTexture.pixelInset.x = 180.0f;
	}if(health == 85){
	healthTexture.pixelInset.x = 170.0f;
	}if(health == 80){
	healthTexture.pixelInset.x= 160.0f;
	}if(health == 75){
	healthTexture.pixelInset.x = 150.0f;
	}if(health == 70){
	healthTexture.pixelInset.x = 140.0f;
	}if(health == 65){
	healthTexture.pixelInset.x = 130.0f;
	}if(health == 60){
	healthTexture.pixelInset.x = 120.0f;
	}if(health == 55){
	healthTexture.pixelInset.x = 110.0f;
	}if(health == 50){
	healthTexture.pixelInset.x = 100.0f;
	}if(health == 45){
	healthTexture.pixelInset.x = 90.0f;
	}if(health == 40){
	healthTexture.pixelInset.x = 80.0f;
	}if(health == 35){
	healthTexture.pixelInset.x = 70.0f;
	}if(health == 30){
	healthTexture.pixelInset.x= 60.0f;
	}if(health == 25){
	healthTexture.pixelInset.x = 50.0f;
	}if(health == 20){
	healthTexture.pixelInset.x = 40.0f;
	}if(health == 15){
	healthTexture.pixelInset.x= 30.0f;
	}if(health == 10){
	healthTexture.pixelInset.x = 20.0f;
	}if(health == 0){
	healthTexture.pixelInset.x= 5.0f;
 }
}

void OnTrigger(Collider other)
{
if(other.gameObject.tag == "Enemy")
{
	health = health - 5;
}

}

}

Assets/Adventure Game/MaleCharacterPack/VincentSword_Control.cs(21,39): error CS1612: Cannot modify a value type return value of `UnityEngine.GUITexture.pixelInset’. Consider storing the value in a temporary variable

I don’t know what you are doing with that pixelInset thing but I recommend a new approach. Take a % of the health and use that % to set the width of the texture to display in OnGUI; you can replace all that stuff in Update() with something like this

public void calcHealthPct(float curHealth) {
	curHealthPCT= (curHealth/maxHealth)*100f;
	curHealthTextureWidth= ((curHealthPCT/100.0f)* maxHealthTextureWidth);
}

You can only do that in Unityscript. For C#, you have to do what the error says and make a temporary variable (a new Rect), modify it, then assign it again. Also, instead of having a million if statements, just use some math. It will make your code far shorter and more manageable. (For even better results, instead of constantly polling the health variable every frame in Update, only do that in a function where the health actually changes, such as the OnTrigger function.)