I question popped in my head.
"How can I list all the items in a player's backpack?"
I tried to make it work but it utterly failed...
So, I was wondering if anyone would be willing to teach me all the things that would be included in lists.
Volodymyr2004 suggested using a for loop
. Don't. Use a pairs loop
. Pairs loops are made specifically for this purpose.
local backpack = player.Backpack local children = backpack:GetChildren() for i,v in pairs(children) do print(v.Name) end
Good Luck!
You can get the children of backpack,
local tools=BackPack:GetChildren()
Then you can list of the items 1 by 1 in a loop until all items have been listed
for i=1, #tools do --will go through children 1 by 1 print(tools[i].Name) --prints tool's name end --end
Hope this helped!