So I made a script that makes a rarity chooser here it is, problem is at the bottom:
--LOCALS--
local Player = game.Players.LocalPlayer
local Selector = math.random(1,6)
print(Selector)
--NUMBERS BETWEEN--
local A = math.random(70,100)--Common
local B = math.random(40,69)--Uncommon
local C2 = math.random(10,39)--Rare
local D = math.random(3,9)--Epic
local E2 = math.random(1,2.9)--Light
local F = math.random(0.1,0.9)--Shadow
print(A, B, C2, D, E2, F)
--NAMES--
local C = "Common"
local UC = "Uncommon"
local R = "Rare"
local E = "Epic"
local L = "Light"
local S = "Shadow"
--RARITIES--PERCENTAGE
Common = 70
Uncommon = 40
Rare = 10
Epic = 3
Light = 1
Shadow = 0.1
local Rarities = math.random(Shadow, Common)
print(Rarities)
--PRICES--
local Common2 = 1000
local Uncommon2 = 1750
local Rare2 = 4000
local Epic2 = 10000
local Light2 = 100000
local Shadow2 = 500000
--SCRIPT--
--COMMON--
if Selector == 1 then
if Rarities == Common or A then
print(C)
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value + Common2
end
end
--UNCOMMON--
if Selector == 2 then
if Rarities ==Uncommon or B then
print(UC)
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value + Uncommon2
end
end
--RARE--
if Selector == 3 then
if Rarities ==Rare or C2 then
print(R)
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value + Rare2
end
end
--EPIC--
if Selector == 4 then
if Rarities ==Epic or D then
print(E)
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value + Epic2
end
end
--LIGHT--
if Selector == 5 then
if Rarities ==Light or E2 then
print(L)
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value + Light2
end
end
--SHADOW--
if Selector == 6 then
if Rarities == Shadow or F then
print(S)
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value + Shadow2
end
end
the problem is when the selector gets a number and the rarity's number are different, the script chooses the Selector and it adds the rarity's value to the Gold example..
Selector = 6 Which is Shadow Rarities = 50 which is Uncommon
The script will choose to add the shadow's value instead of being nil Any Ideas?

1 comment
sorry for my bad english :(