Help Needed: Modular Gacha System with Single/10x Rolls and Stardust Currency

Hey everyone,

I’m working on a gacha system for my Roblox game and could use some advice on how to set it up. Here’s what I’m aiming for:

Single roll & 10-roll buttons so players can roll once or 10 times at a time.
Random rewards: each roll can give an emote, character skin, or character.
Duplicates: if a player gets a duplicate, they should get Stardust instead (amount depends on rarity).
Stardust shop: players can use Stardust to buy characters directly, instead of rolling.
Multiple banners: players can switch between banners using buttons.
Modular & organized: I want the system to be easy to tweak and add new items/banners, with folders for organization.
Basically, I want a clean, easy-to-update gacha system that handles duplicates and Stardust properly.

If anyone has example scripts, advice, or best practices for this kind of setup, that would be awesome.

Thanks!

I used to have a simple Gacha library that would be perfect for you. Not sure what happened to it since I can’t find it. So, while I can’t just send you the rbxm for it, I can show you what it looked like to hopefully guide you on how you might structure yours.

It looked something like this

local Gacha = require(path.to.module)

local myBanner = Gacha.banner({
    {
        weight = 50,
        items  = {
            { item = "Emote 1", weight = 70 },
            { item = "Emote 2", weight = 30 }
        }
    },
    {
        weight = 50,
        items  = {
            { item = "Skin 1", weight = 60 },
            { item = "Skin 2", weight = 40 }
        }
    }
})

local result = myBanner:pull() -- Returns a SINGLE item

local result2 = myBanner:pullMany(10) -- Returns 10 items

-- From here you can process them, e.g. turning duplicates into something else.

Again: I do not have this system anymore. I think I might have accidentally deleted it. I may come back to it some time in the future and remake it, but until then I hope the general structure of how it worked will help you.

is the weight the rarity? just checking

Yes, the module was an overengineered weighted RNG library.