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

How Do I Add Picked Up Items To Backpack Gui?

Asked by 5 years ago
Edited 5 years ago

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

0
Show your attempt. SummerEquinox 643 — 5y

1 answer

Log in to vote
0
Answered by
PWNTART 33
5 years ago
Edited 5 years ago

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)
0
use a code block WideSteal321 773 — 5y
0
Thank you Odlnsonthor 11 — 5y
Ad

Answer this question