RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"a lottery gui with a working spin and rarity system"
-- Local Script in the SpinButton within the Lottery GUI local button = script.Parent local rarityColors = { Common = Color3.fromRGB(255, 255, 255), Uncommon = Color3.fromRGB(0, 255, 0), Rare = Color3.fromRGB(0, 0, 255), Epic = Color3.fromRGB(128, 0, 128), Legendary = Color3.fromRGB(255, 215, 0) } local function spin() local rarity = "" local chance = math.random(1, 100) if chance <= 50 then rarity = "Common" elseif chance <= 75 then rarity = "Uncommon" elseif chance <= 90 then rarity = "Rare" elseif chance <= 98 then rarity = "Epic" else rarity = "Legendary" end local result = script.Parent.Parent.Result result.BackgroundColor3 = rarityColors[rarity] result.Text = rarity end button.MouseButton1Click:Connect(spin)