I suggest you create an array with 1 element for each object, and in that element store the floating point percentage `weight` for that item.
Then to look up an item, generate a floating point percentage:
Then implement a binary search which starts at the middle of the array and reads the weight of that item and goes from there to find the closest matching weight. Your percentages in the array have to be sorted in order. That will be a lot quicker than searching through the array.
Then to look up an item, generate a floating point percentage:
Local Percentage:Float=FloatRnd()*NumberOfArrayElements
Then implement a binary search which starts at the middle of the array and reads the weight of that item and goes from there to find the closest matching weight. Your percentages in the array have to be sorted in order. That will be a lot quicker than searching through the array.