Answers for "gms2 init empty array"

2

gms2 init empty array

// Create an empty array using a script

// in the script
function EmptyArray1(arrLength) constructor { // Create new 1d array
	arr = {};
	for(var i=arrLength-1;i>0;i--) {
		arr[i] = -1; // Your value you want to fill the array with
	}
}

// where you want to create the array
var array = createEmptyArray(length);
Posted by: Guest on May-09-2021

Browse Popular Code Answers by Language