NPC Code:
myarray=1;
myarray[0]=1;
myarray[1]=5;
myarray[2]=67;
mything=myarray;
mything would equal 1 after this code. It reads myarray and a variable, but will read
myarray[#] as a position in the array
myarray. If you want to copy an array to another array, do this:
NPC Code:
myarray = {1, 5, 67};
setarray myarray2, arraylen(myarray);
for (this.z = 0; this.z < arraylen(myarray); this.z++) {
myarray2[this.z] = myarray[this.z];
}
That should work. I haven't actually used setarray in a while though...I'm used to doing it the quick way like I did in the first line of that.