Display User Inventory

Hello developers,

I am trying to make a player information GUI where it displays information about a selected player. I want it to display the players backpack but I don’t know how to display every tool I only know how to see if the player has the tool. I am using UIListLayout. I need it to only display the tool name. Can anyone help?

If you want to find all of the tools inside a player’s backpack use a for i,v in pairs loop:

for Index, Value in pairs(game:GetService("Players").Player.Backpack:GetChildren()) do
--Each loop indexes an item in the backpack
end

You can then use the information provided above to add the tools to the gui

Ok, I tried this. No errors at all just not working. Whats wrong with it?

for Index, Value in pairs(game:GetService("Players"):FindFirstChild("Hayden_A28").Backpack:GetChildren()) do
	local TextThing = script.Parent.TextLabel:Clone()
	TextThing.Text = Value.Name
end

You have to set a parent to TextThing as a Cloned instance by default is parented to nil

1 Like