Instantiate Gui Textures

Trying to remove a game object from the screen and replacing it with a GUITexture. The problem is that I get an error I try to instantiate anything other than GameObjects.

using UnityEngine;
using System.Collections;

public class object_temp : MonoBehaviour {
	
	public Texture[] ScoreTex;
	public GUITexture ScoreHolder;
	public GUIText ScoreText;
	//public GameObject GUIholder;
	
	private int rand;
	//private bool guiScore;
	//private float posX;
	//private float posY;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnMouseDown()
	{
		rand = Random.Range(0,2);
		//guiScore = rand;
		ScoreHolder.texture = ScoreTex[rand];
		
		//posX = this.transform.position.x;
		//posY = this.transform.position.y;
		
		Destroy(this);
		
		if(rand == 1)
		{			
			ScoreText.text = "20";
			ScoreHolder = Instantiate(ScoreHolder);
			ScoreHolder.transform.position = this.transform.position;
		}
		else
		{
			ScoreText.text = "10";
			ScoreHolder = Instantiate(ScoreHolder);
			ScoreHolder.transform.position = this.transform.position;
		}
		Debug.Log("MouseDown");	
	}
}

just add “as GUITexture” at the end after the “)” it should work then. In c# you have to tell what you gonna instantiate when you store it into a variable. I guess it’s like the “new” part that’s needed here and there :stuck_out_tongue:

Would look like this:

ScoreHolder = Instantiate(ScoreHolder) as GUITexture;