8,756
edits
(new option: roll which can be "once" (default, calculates weights against all) or "each" (weight/100)) |
mNo edit summary |
||
Line 53: | Line 53: | ||
finalTable[i]['chance'] = string.format("%.2f%%",row['weight']*100/totalWeight) | finalTable[i]['chance'] = string.format("%.2f%%",row['weight']*100/totalWeight) | ||
elseif pick == 'each' then | elseif pick == 'each' then | ||
finalTable[i]['chance'] = string.format("%.2f%%",row['weight'] | finalTable[i]['chance'] = string.format("%.2f%%",row['weight']) | ||
else | else | ||
error('"roll" parameter takes only "once" or "each"!') | error('"roll" parameter takes only "once" or "each"!') |