I’m not sure why you have a while event. The random number should be from 0 to the size of the array (number of children ) -1 since the 1st element is 0.
Here’s another example. It picks 4 numbers at a time. You wouldn’t need the repeat. I’m not at my PC or I would create something new.
The strategy is:
Create an array with the numbers you want picked. In this example, I set index to 1 and repeated it 10 times. So, the array had the numbers 1 thru 10. In this version, it automatically creates the array if there are no children. Sort of like shuffling cards when all are dealt.
To choose a number you pick a random number from 0 to the number of children in the array -1 because the array starts at (0)
You then pick the value in the array and then delete that element