#rng script
1 messages · Page 1 of 1 (latest)
You have to attempt to make it first before we help you. Also you can probably find a tutorial on this
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
** You are now Level 2! **
Did it work?
I feel like I remember a similar script from a simulator egg tutorial
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
@patent remnant
if that’s the whole script
add end) at the end