local i1 = "rbxassetid://" -- hidden
local i2 = "rbxassetid://"
local i3 = "rbxassetid://"
script.Parent.Parent.ScrollingFrame.Visible = false
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.ScrollingFrame.Visible = true
local amount = game.Players.LocalPlayer.CurrentPets:GetChildren()
for i,v in pairs(amount) do
local xd = Instance.new("ImageButton")
xd.Parent = script.Parent.Parent.ScrollingFrame
end
end)
It doesn't want to be the GUI's child, but when I put the parent as the player, it works?

4 comments
^^ yes it is a local script
What do you mean by "when I put the parent as the player"?
So when I do "xd.Parent = game.Players.LocalPlayer"
Then try doing "xd.Parent = game.Players.LocalPlayer.PlayerGui...". Its not a good idea anyway to use script.Parent... since it is relitive to the scripts position.