Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Do I Add Picked Up Items To Backpack Gui?

I have a script that allows a user to use the letter e to pickup but cannot walk over it too pick up only via the e key, so basically it some how has to add it into you inventory gui which would be located on the side of the screen. i have tried using an on screen gui but am unsure where to go from there. So the end result would be clicking on the backpack gui and then having it open up all your items in your inventory

1 comment

0

Show your attempt.

1 answer

✓ Accepted answer

You can use the players backpack(even if its hidden) to store items. You can use: https://developer.roblox.com/api-reference/event/Instance/ChildAdded,

then Instance.new so that when a child is added to the backpack, a new gui with the childs name or picture appears in the backpack. For the backpack guis you can organize them by using the UI constraints like: https://developer.roblox.com/api-reference/class/UIListLayout or https://developer.roblox.com/api-reference/class/UIGridLayout.

Ex:

plr.Backpack:ChildAdded(connect(function(child)

local item = Instance.new("TextButton",(Inventory Name))

item.Name = child.Name

end)

2 comments

0

use a code block

0

Thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.