Buttons don't show except for one in for loop

Before you ask, yes I did but a UIListLayout. Here is my code.

	for i, v in ipairs(plr.InventoryF:GetChildren()) do
		local button = Inventory.ScrollingFrame.Template:Clone()
		button.Visible = true
		button.Text = v.Name
		button.Parent = Inventory.ScrollingFrame

		button.Activated:Connect(function()
			currentSelectedButton = button
			currentSelectedItem = v
			toggleSelectionInfo()
		end)
	end

I thought this was super weird. It ran through every item, yet it didn’t clone the buttons. I tried making it so that when you click the inventory button, it updates. But that dosen’t work either.

1 Like

If you look in explorer once the code has run in game, does it show multiple buttons under Inventory.ScrollingFrame, or is it only showning one?

1 Like

Nevermind, I solved it. I didn’t check if V:IsA(“UIListLayout”) so it didn’t work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.