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

0

^^ yes it is a local script

0

What do you mean by "when I put the parent as the player"?

0

So when I do "xd.Parent = game.Players.LocalPlayer"

0

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.