-- LUCK MULTIPLIER TYPING SYSTEM IS STILL A W.I.P

local Config = {}

Config.Rarities = {
    "Common", "Uncommon", "Rare", "Epic", "Legendary", "Exotic", "Mythic", "???"
}

Config.RarityRate = {
    ["Common"] = 54,
    ["Uncommon"] = 30,
    ["Rare"] = 10,
    ["Epic"] = 5,
    ["Legendary"] = 0.95,
    ["Exotic"] = 0.0495,
    ["Mythic"] = 0.000495,
    ["???"] = 0.000005,
}

function RollRandomItem(ItemPool, LuckMultiplier)
    if not LuckMultiplier or not tonumber(LuckMultiplier) then
        LuckMultiplier = 1
    end
    
    local randomNumber = math.random(1, 100)
    local counter = 1

    for rarity, chance in pairs(ItemPool) do
        counter = counter + chance * LuckMultiplier

        if randomNumber < counter then
            return rarity
        end
    end

    print("%'s don't add up to 100. Fix it.")
    return "Common"
end

for i = 1, 1024, 1 do
    local LM = tonumber(io.read())
    local Rarity = RollRandomItem(Config.RarityRate, LM)
    print(Rarity)
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: