Change materials to all the elements from an array

Ok sir, I almost got it, but I won’t ask about it since I think that experience will be the one that clarifies to me how to get to the same result as yours.

Thanks again