So I started doing my pet system (only in my case the eggs drop items so it is a system of things), but I can not figure out how I do the second check, I explain here I have a local script, in the GUI
local rp = game:GetService("ReplicatedStorage")
local things = rp:WaitForChild("EggThings")
local eggs = workspace:WaitForChild("Eggs")
wait(3)
for i, v in pairs(eggs:GetChildren()) do
local eggThings = things:FindFirstChild(v.Name)
if eggThings ~= nil then
local billboardTemp = script.Template:Clone()
local container = billboardTemp:WaitForChild("Container")
local container1 = container.Container1
billboardTemp.Parent = script.Parent.Parent.EggBillboards
billboardTemp.Name = v.Name
billboardTemp.Adornee = v.Egg_1
billboardTemp.Enabled = true
for _, thing in pairs(eggThings:GetChildren()) do
if thing.RarityString.Value == "Common" then
if thing.RarityString.Value == "Rare" then
print("container2")
local clonedTemp2 = container.Container2:Clone()
clonedTemp2.Name = thing.Name
clonedTemp2.Rarity.Text = tostring(thing.Rarity.Value).. "%"
clonedTemp2.Visible = true
clonedTemp2.Parent = container
end
print("container1")
local clonedTemp1 = container1:Clone()
clonedTemp1.Name = thing.Name
clonedTemp1.Rarity.Text = tostring(thing.Rarity.Value).. "%"
clonedTemp1.Visible = true
clonedTemp1.Parent = container
end
end
end
end
But as you can see when I try to do a second check the rarity of the item it is not done, and comes out like this:
I explain, it chose the item common, but I need all the items of the whole rarity, from common, to mythic. But I donβt know how to check for all rarity? Hereβs the guide I was doing: