Will depend on what Foundations
can contain, but first you have another problem already, a “pure” function in BP (no white execution lines in/out) will be called once every-time it is used, so you are currently not storing the same value you scale with, they are two separate random numbers.
You will need to store the result of calling Random Float in Range in a variable (prefer local if in a function, consider putting this in a function if on a event graph).
So onto the main event then: If your Foundations
(scene component?) contains ONLY static mesh components as children, then you can just use the index from the for loop you are in:
If there are potentially other components interspersed, then you will need to use a counter: