local child = game:GetService("Workspace").Eggs:GetChildren()
local RS = game.ReplicatedStorage
local Library = RS.Pets
local Eggs = require(Library:WaitForChild("Eggs"))
local plr = game.Players.LocalPlayer
local rarities = {[1] = {"Common"},[2] = {"Rare"}}
for i, v in pairs(game:GetService("Workspace").Eggs:GetChildren()) do
local new = script.Parent.Parent:WaitForChild("IndexClone").Frame:Clone()
new.Parent = script.Parent.Frame
new.TextLabel.Text = tostring(v.Name)
new.Name = v.Name
for i, v in pairs(Eggs[v.Name]["Pets"]) do
print(v.Name)
local petClone = new.Frame.Frame:Clone()
petClone.Parent = new.Frame
petClone.Visible = true
--petClone.PetName.Text = v.Name
petClone.Name = v.Name
local ModelClone = game.ReplicatedStorage.Pets.Models:WaitForChild(v.Name).Normal:Clone()
local Pos = ModelClone.PrimaryPart.Position
local camera = Instance.new("Camera")
petClone.ViewportFrame.CurrentCamera = camera
ModelClone.Parent = petClone.ViewportFrame
camera.CFrame = CFrame.new(Vector3.new(Pos.X + 2.25, Pos.Y, Pos.Z + 1), Pos)
end
end
while wait() do
for i, egg in pairs(game:GetService("Workspace").Eggs:GetChildren()) do
for i, pets in pairs(Eggs[egg.Name]["Pets"]) do
for i, owned in pairs(plr:WaitForChild(plr.Name):GetChildren()) do
if owned.Name == pets.Name then
local eggHolder = script.Parent.Frame:WaitForChild(egg.Name)
eggHolder.Frame:WaitForChild(pets.Name).ViewportFrame.ImageColor3 = Color3.fromRGB(255, 255, 255)
else
local eggHolder = script.Parent.Frame:WaitForChild(egg.Name)
eggHolder.Frame:WaitForChild(pets.Name).ViewportFrame.ImageColor3 = Color3.fromRGB(0, 0, 0)
end
end
end
end
end
Can someone please help. I am making an index and the problem is that it only loops once and not everything
for i, egg in pairs(game:GetService("Workspace").Eggs:GetChildren()) do
for i, pets in pairs(Eggs[egg.Name]["Pets"]) do
for i, owned in pairs(plr:WaitForChild(plr.Name):GetChildren()) do
if owned.Name == pets.Name then
local eggHolder = script.Parent.Frame:WaitForChild(egg.Name)
eggHolder.Frame:WaitForChild(pets.Name).ViewportFrame.ImageColor3 = Color3.fromRGB(255, 255, 255)
else
local eggHolder = script.Parent.Frame:WaitForChild(egg.Name)
eggHolder.Frame:WaitForChild(pets.Name).ViewportFrame.ImageColor3 = Color3.fromRGB(0, 0, 0)
end
end
end
end
end
So if I played the game, the folder would be called Vorexted, correct? Just clearing up that you didn’t make a typo. Then I will look through it more.
yeah so basicly if I hatch a egg a string value is added which stores everything you have hatched. And basicly Each time you hatch something it should be able to determine if the folder string value is also “pets.Name”. Problem is when you hatch the other viewport frame that WAS NOT BLACK turned black
That is great. I just have an “owned” folder that I use for my pet index. Also, by any chance, are you using a pet system you found somewhere? It seems oddly familiar to something a friend of mine made just wondering Good luck!
Yeah I am using once called Agent Pet System for now. Basicly my friend is making his own game and doesn’t really know how to script so I just made one for him and he is using the same one
Hey, do you know how to use this system. Only because I need some help because I did everything I need to but when I go to open the egg nothing happens as no index pops up, I cannot open an egg or anything.