Local script:
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.Rarity.Value == 50 then
local clonedTemp1 = container1:Clone()
clonedTemp1.Name = thing.Name
clonedTemp1.Rarity.Text = tostring(thing:WaitForChild("Rarity").Value).. "%"
clonedTemp1.Visible = true
clonedTemp1.Parent = container
print(clonedTemp1, thing.Rarity.Value)
end
if thing.Rarity.Value == 35 then
local clonedTemp2 = container.Container2:Clone()
clonedTemp2.Name = thing.Name
clonedTemp2.Rarity.Text = tostring(thing:WaitForChild("Rarity").Value).. "%"
clonedTemp2.Visible = true
clonedTemp2.Parent = container
print(clonedTemp2, thing.Rarity.Value)
end
if thing.Rarity.Value == 14 then
local clonedTemp3 = container.Container3:Clone()
clonedTemp3.Name = thing.Name
clonedTemp3.Rarity.Text = tostring(thing:WaitForChild("Rarity").Value).. "%"
clonedTemp3.Visible = true
clonedTemp3.Parent = container
print(clonedTemp3, thing.Rarity.Value)
end
if thing.Rarity.Value == 0.96 then
local clonedTemp4 = container.Container4:Clone()
clonedTemp4.Name = thing.Name
clonedTemp4.Rarity.Text = tostring(thing:WaitForChild("Rarity").Value).. "%"
clonedTemp4.Visible = true
clonedTemp4.Parent = container
print(clonedTemp4, thing.Rarity.Value)
end
if thing.Rarity.Value == 0.04 then
local clonedTemp5 = container.Container5:Clone()
clonedTemp5.Name = thing.Name
clonedTemp5.Rarity.Text = tostring(thing:WaitForChild("Rarity").Value).. "%"
clonedTemp5.Visible = true
clonedTemp5.Parent = container
print(clonedTemp5, thing.Rarity.Value)
end
end
end
end
So I explain what the problem is, I looked at this guide:
and decided to redo it a little bit, how exactly? I decided to add the following if the rarity of the item for example 0.04, then throw it in the fifth compartment, which is exactly where the mythical things lie. But the problem is that when you start the game happens the following:
That is, as you can see, four compartments appear, but on the fifth appears this error, which you have already seen. And then the question is, why is that?