How do Ensure that a series of int's are never the same?

///7 random int values///
var r1 : int;
var r2 : int;
var r3 : int;
var r4 : int;
var r5 : int;
var r6 : int;
var r7 : int;

//randomize the numbers//
function Start(){


r1 = Random.Range(0, 51);
r2 = Random.Range(0, 51);
r3 = Random.Range(0, 51);
r4 = Random.Range(0, 51);
r5 = Random.Range(0, 51);
r6 = Random.Range(0, 51);
r7 = Random.Range(0, 51);



//It has to be 7 entirely different numbers between 0 and 51//

//PLEASE HALP ME//
}

none of these ints can ever be the same… that would cause major breakage in the game… please halp.

Two ways to do this.

For the simple case like yours you can simply check against each value to see it is unique. If it is not unique then randomize it until a unique value is returned.

The complex case is used with more numbers, or where checking the uniqueness is difficult or time consuming, or if you need to randomise the entire range. Typically you create the entire range of possibilities in a list. Then remove that item from the list once it is created, meaning it can never be selected again.