expected type array but received type undefined error.

tried using the better settings extension in my attempt to make chess to use number arrays to store an x and y value, using an index in the name of the setting. (like this):

image

0 is the x value and 1 would be the y value.

I am only using this method for the king’s movement as it is a lot more complicated than the other pieces. here is where the settings are being initialized:

(I do it like this because after all of the moves are there, it checks each of the positions to see if it is legal and if it is not it removes the setting with that name)… or at least it is supposed to because I get an error every time i try to use the part of code in the first image, and I’m pretty sure that I’m not giving it an undefined.

if somebody could try and help to explain why I am getting this error that would be great.

here is the project link: https://arcade.makecode.com/S47345-23649-93143-12607