Seriously, why do you need this array? Working with instance variables in C2 is much easier than working with 2D arrays.

If you are sure that you need the array, consider doing this:

Create 1-dimentional array, set Global=No, add it to the same container with the sprite. Now each instance of sprite will have its own instance of array for values. Sprite+array in each pair will be logically linked together, you'll not need the ID variable. You can pick a sprite and its own array will be picked automatically, and vice versa.

This code will search all arrays for a number N and destroy sprites (and their arrays) if the number is found:

@dop2000 i use an array because i have to remove for example n+3 sprites or n-3 sprites, i have to concatenate after the rest of sprites and reorder by id all and i don 't know it s possible just with instance variables?

Not exactly . For example i have 10 sprites with instance variable "ID" 0 to 9 and second instance variable "NUM" random 1 to 4 . I have a random number "n" start 0 until 9 and a second number "NUM2" random 1 to 4 . If "n" has value 3 for example i ll must check in the list of sprites the n+1, n+2 or n-1, n-2 so it will be sprites with ID 4,5 or 2,1 . After with the number "NUM2" i must compare instance variable "NUM" of sprite 4,5 or 2,1 and if is equal i destroy sprites with ID 4,5 or 2,1 and to finish i reorder the list of id like you say