Help with inventory gui

Hello, and i want to make an inventory gui, but i don’t know where to start!
When you press G, the gui opens.

https://gyazo.com/d606a0dbe4d3fff17f05058162b8e679

I want to make it so when a new tool is added to the player’s backpack, a new button appears, with the text of the tool. When the tool is removed from the player’s backpack, the text button isn’t shown.

Here’s the gui and all of its contents.
image

And the open script, if this offers any help.
image

Things I’ve tried to implement

I’ve tried to make it so when you equip a tool, the button clones into the scrolling frame in the GUI, but that proved unsuccessful.

I’d really appreciate some help, I’ve been working on this for a couple of days now.

Thank you.

This is my first time creating a topic, so i don’t know how it usually works.

You could connect a ChildAdded event to the player’s backpack and clone a TextButton into the inventory frame

Tip: Make sure to do ServerSided checks when player equips a specific item!

1 Like

Would i need a remote event for that?

No, you can do the ChildAdded event and adding of button client sided. While making the equip script, make sure to check server sided whether the player has the item in their backpack.

You can populate that GUI, with a table, made of the backpack’s Children.
And on New Children added to the backpack, update the table, then update the GUI.

Your GUI Scroll list, should be populated based on the backpack’s inventory.

2 Likes

I’ll try to implement that, thank you!

1 Like

This is what i’ve got so far:

image

@Dev_Peashie Sorry for the late reply, thank you for sending this!

I’m unsure on how to use tables.

Could you send a sample of one?

Can you send me a file of this place? I’ll send it after making the script. (I’ll explain the script too)

Sounds good! Here’s the file: Inventory fix.rbxl (116.4 KB)

Thank you!

Hey, here is the completed file. If you need an explanation, feel free to ask me!

InventoryFixed.rbxl (117.3 KB)

1 Like

Thank you, this is really great!

1 Like