check two arrays

ok so im pretty new with using arrays

i want to make a main array and three other arrays all holding 3(all int vaules). i want the three to check against the main one. I know that the function can be repeated so im happy with two arrays at moment. I want to know if the numbers are in the same order. i want the players input for the PY1array to be input by GUI buttons, but for now it doesnt matter, which i understand for now could also be 1,1,2,4… if they are false i want a boolean to switch on…thanks :slight_smile:

Marray = int[1,1,2,4]
PY1array = int [3] 
ill : boolean

function check(){
    if (Marray == PY1array){ 
        result();
    }
}

function result (){
    Debug.Log("it is false");
    ill = false;
}

By testing == between two array, you’re checking if the two references matches (I think) and they wont.

You want to check if each element has the same value and same order, so use a for (or other loop) to go through each array and check each members.