Well I wanted to make a randomizer and I know I could use math.random(1,5) or something like that but what if I want to have different types like legendary, epic and stuff. Heres what I got so far:

local QVLeg = math.random(1,100)
local QVEpi = math.random(1,90)
local QVRar = math.random(1,75)
local QVUnc = math.random(1,50)
local QVCom = math.random(1,25)

local QR = script.Parent.QuirkText
local QRV = script.Parent.Quirk
local Rarity = script.Parent.Parent.Rarity.RarityText
local RarityB = script.Parent.Parent.Rarity

--Colors
local Legendary = Color3.fromRGB(241,196,15)
local Epic = Color3.fromRGB(155,89,182)
local Rare = Color3.fromRGB(52,152,219)
local Uncommon = Color3.fromRGB(46,204,113)
local Common = Color3.fromRGB(149,165,166)
--Background Colors
local LB = Color3.fromRGB(243,156,18)
local EB = Color3.fromRGB(142,68,173)
local RB = Color3.fromRGB(41,128,185)
local UB = Color3.fromRGB(39,174,96)
local CB = Color3.fromRGB(127,140,141)


script.Parent.MouseButton1Down:Connect(function()

	
	if QVLeg == 100 and not QVEpi.Value == 90 and not QVRar.Value == 75 and not QVUnc.Value == 50 and not QVCom.Value == 25 then
		--Stuff
		
	elseif not QVLeg.Value == 100 and QVEpi.Value == 90 and not QVRar.Value == 75 and not QVUnc.Value == 50 and not QVCom.Value == 25 then
		--Stuff
		
	elseif not QVLeg.Value == 100 and not QVEpi.Value == 90 and QVRar.Value == 75 and not QVUnc.Value == 50 and not QVCom.Value == 25 then
		--Stuff
		
	elseif not QVLeg.Value == 100 and not QVEpi.Value == 90 and not QVRar.Value == 75 and QVUnc.Value == 50 and not QVCom.Value == 25 then
		--Stuff
		
	elseif not QVLeg.Value == 100 and not QVEpi.Value == 90 and not QVRar.Value == 75 and not QVUnc.Value == 50 and QVCom.Value == 25 then
		--Stuff
	end
end)


Thanks in Advance!

  • DindinYT37

4 comments

0

use math.random

0

If you would've looked in my script you would've seen that I used it and it didn't work

1

n = math.random(1,1000); if n < 500 then return quirk1 else if n < 800 then return quirk2 else return quirk3 end

0

Thanks