Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Figure out how to list all items in backpack?

Asked by 4 years ago

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
1
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 DhMrfuun 1 — 4y

1 answer

Log in to vote
1
Answered by
exobyteXL 290 Moderation Voter
4 years ago
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

Ad

Answer this question