Is there any other rarity system besides this basic rarity script?

Hi people, I want to know if there’s a another rarity system other than the script that I will give as an example.

local function Luck()
   	local Sum = 0
	for i,v in pairs(Chances) do
		Sum += v
	end
	local random = Random.new()
	local SumChance = random:NextNumber(0,Sum)
	for i,v in pairs(Chances) do
		if SumChance < v then
			return i
		end
		SumChance -= v
	end 
end  

This is an example of the common rarity system usage. I want to know if there is another system that is more advanced or else.