How to make this function?
I have a
Code: Select all
table = {
{name = "name-01", probability = 100},
{name = "name-02", probability = 90},
{name = "name-03", probability = 20},
{name = "name-04", probability = 20},
...
}
The first step is easy, I need to get summary of all probabilities and then I can get
Code: Select all
number =math.rnd(probability_summ(table))