I have a chance/roll system similar to Sol’s RNG. 1 in 3, 1 in 10, 1 in 10.000 and so on. What I am trying to achieve is like 10% luck boost, 20% or even 100% luck boost. How could I implement this without it making easier to pull common ones as well.
local module = {
getRandomIndex = function(chances, luck)
for i,v in ipairs(chances) do
local totalluck = luck
local randomNumber = math.random(1, v[2])
if randomNumber == 1 and v[2] > chances[1][2] then
return {
v[1]; v[2];
}
end
end
return chances[1]
end,
}
return module