#rng script

1 messages · Page 1 of 1 (latest)

fallen coyote
#

can someone help me to make rng system(like sols rng)

#

thanks

patent remnant
lime hill
fallen coyote
# patent remnant You have to attempt to make it first before we help you. Also you can probably f...
local player = game.Players.LocalPlayer
local rollResult = script.Parent.Parent:WaitForChild("RollResult") 

local rarities = {
    {name = "Common", chance = 50, color = Color3.fromRGB(200, 200, 200)},
    {name = "Uncommon", chance = 30, color = Color3.fromRGB(0, 255, 0)},
    {name = "Rare", chance = 15, color = Color3.fromRGB(0, 0, 255)},
    {name = "Epic", chance = 4, color = Color3.fromRGB(128, 0, 128)},
    {name = "Legendary", chance = 1, color = Color3.fromRGB(255, 215, 0)},
}

local function rollAura()
    local randomRoll = math.random(1, 100) 

    local cumulativeChance = 0
    local selectedAura = nil

   
    for _, aura in pairs(rarities) do
        cumulativeChance = cumulativeChance + aura.chance
        if randomRoll <= cumulativeChance then
            selectedAura = aura
            break
        end
    end

    return selectedAura
end

button.MouseButton1Click:Connect(function()
    
    local aura = rollAura()

    rollResult.Text = "You rolled a " .. aura.name .. " aura!"
    rollResult.BackgroundColor3 = aura.color  ```
#

i tried something

#

@lime hill

fading prawnBOT
#

studio** You are now Level 2! **studio

patent remnant
#

Did it work?

#

I feel like I remember a similar script from a simulator egg tutorial

fallen coyote
#

im making from studio lite

#

my pc is so old

#

do u know no case pcs?

#

it opening studio but if i press f11 or smth crashed lemme test

fallen coyote
#

@patent remnant

lime hill
#

did it work

#

oh

lime hill
#

add end) at the end