How can I have a gui.button return a random number and display it?

Sorry for the noob question, but I couldn’t find anything that specifically remedies my problem.
I want the player to be able to press a gui button and have it return a random number between 1 and 6 like a normal dice. I need the button to change its texture to he corresponding number, and I also need the number to change in a public float so it can be seen by the other scripts.
This is what I have, but I’m not very good at code and it doesn’t work correctly, nor is it finished:
using UnityEngine;
using System.Collections;

public class DieValue : MonoBehaviour {

	public float currentValue = 1f;
	public float diceRoll = Random.Range(1f, 6f);
	public Texture btnTexture;
	public Texture btnTexture1;
	public Texture btnTexture2;
	public Texture btnTexture3;
	public Texture btnTexture4;
	public Texture btnTexture5;

	// Use this for initialization
	void Start () {
	
	}

	//void Update () {
	//	if(currentValue == 1)
	//}

	void OnGUI() {
		if (GUI.Button(new Rect(30, 650, 90, 90), btnTexture))
			diceRoll = currentValue;
			Debug.Log("You rolled a" );
			
		
	}
}

Thanks for any help. I’m usually the art guy so I get lost when it comes to coding well.

First put your button textures in an array this will make it easier to access them

public Texture[] btnTextures;

void Start()
{
   btnTextures = new Textures[6];
   butTextures[0] = btnTexture1;
   butTextures[1] = btnTexture2;
   .....etc untill you have filled your array
}

Then you need to change your onGUI method

void OnGUI() {
   if (GUI.Button(new Rect(30, 650, 90, 90), btnTextures(currentValue)))
   diceRoll = currentValue;
   Debug.Log("You rolled a" + diceRoll.ToString());
}

Because OnGUI runs at least once per frame the texture for the button will update in the frame following the calculation thereby selecting the correct image from the btnTextures array.

Hi sir i don’t usually write code, but i will help you (:

using UnityEngine; 
using System.Collections;
    public class DieValue : MonoBehaviour {
     
    
    public int diceRoll;
    public Texture btnTexture;
    public Texture btnTexture1;
    public Texture btnTexture2;
    public Texture btnTexture3;
    public Texture btnTexture4;
    public Texture btnTexture5;
    public Texture actualBtnTexture;
 

    void Start(){
//Here you are saying that when you start the game, the actual texture should be the first one.
actualBtnTexture = btnTexture;

    }

    void OnGUI() {
        if (GUI.Button(new Rect(30, 650, 90, 90),actualBtnTexture)){
            
            Randomize();

            }

void Randomize(){

diceRoll = Random.Range(0,5);
SetTextureButton();

}
 
void SetTextureButton(){

if(diceRoll == 0)
actualBtnTexture = btnTexture;

if(diceRoll == 1)
actualBtnTexture = btnTexture1;

if(diceRoll == 2)
actualBtnTexture = btnTexture2;

if(diceRoll == 3)
actualBtnTexture = btnTexture3;

if(diceRoll == 4)
actualBtnTexture = btnTexture4;

if(diceRoll == 5)
actualBtnTexture = btnTexture5;

}
 
    }
}