How to make chance system with luck?
This chance system but not with luck.
function(PrizeTable)
local totalweight = 0
for _ , Data in PrizeTable do
totalweight += Data.Chance
end
local Chance = math.random(1,totalweight)
local Counter = 0
for i , Data in PrizeTable do
Counter += Data.Chance
if Chance <= Counter then
return Data
end
end
end