I have a system that opens rolls 3 numbers and adds it to a counter of each rarity. They add to a count depending on what it rolls, but it seems like there's too much going on is there a better way to do this?
local roll1 = math.random(1, 100)
local roll2 = math.random(1, 100)
local roll3 = math.random(1, 100)
if roll1 <= 65 then
cCardCount = cCardCount + 1
elseif roll1 > 65 and roll1 <= 85 then
rCardCount = rCardCount + 1
elseif roll1 > 85 and roll1 <= 99 then
eCardCount = eCardCount + 1
else roll1 = 100
lCardCount = lCardCount + 1
end
if roll2 <= 65 then
cCardCount = cCardCount + 1
elseif roll2 > 65 and roll2 <= 85 then
rCardCount = rCardCount + 1
elseif roll2 > 85 and roll2 <= 99 then
eCardCount = eCardCount + 1
else roll2 = 100
lCardCount = lCardCount + 1
end
if roll3 <=65 then
cCardCount = cCardCount + 1
elseif roll3 > 65 and roll3 <= 85 then
rCardCount = rCardCount + 1
elseif roll3 > 85 and roll3 <= 99 then
eCardCount = eCardCount + 1
else roll3 = 100
lCardCount = lCardCount + 1
