I need to figure out how to list all the items in a backpack, but it's only listing one. Help?
for i, v in pairs(playerBackpack:GetChildren()) do
loggedGui.items.Text = v.Name
end
I need to figure out how to list all the items in a backpack, but it's only listing one. Help?
for i, v in pairs(playerBackpack:GetChildren()) do
loggedGui.items.Text = v.Name
end
for i, v in pairs(playerBackpack:GetChildren()) do
loggedGui.items.Text = loggedGui.items.Text .. "\n" .. v.Name
end
\n creates a line break. Learn more about String Patterns on the Roblox Developer Wiki
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
If you using only one TextLabel, You Only see one item Because its overwrites everytime, Gets item from backpack and Writes to TextLabel. Add wait(2), Every 2 seconds you can see item changes