How to create a list of models in a folder

Basically I am making an inventory system, and when objects get broken they get sent to a folder. All I need to do now is make the models in the folder show up on the gui. Ty for help <3

1 Like

I recommend using a UIListLayout since it automatically organizes UI elements. Essentially you want to create a frame (any style, color, any size) and inside you put a UIListLayout.

After this, you want to create a ‘Format’ (think of it as a frame where every item will be layed out), with this format you can display the items since for every item it will duplicate and be put inside the UIListLayout.

Alr, i have done that but what would i say in the script?

Example of a mock-up GUI I made in these 5 mins:


The following is an example of what a ‘Format script’ could look like. For this case I am changing the format ‘Title’ with the name of an instance. This will most likely not fit your needs, but I am only trying to illustrate an example on how you could make a ‘Format script’.

local format = path_to_format; --Here is the frame you want to duplicate

local newEntry = function(name) --In this function we will duplicate the format and change it according to the info we recieve. This is the one to actually make the items on the list
	local clone = format:Clone();
	clone.Parent = path_to_list_frame;
	clone.Title.Text = name;
	clone.Visible = true;

local list = path_to_instance:GetChildren();
for _, i in ipairs(list) do newEntry(i.Name) end;

The image above shows how I made the format for the GUI example I sent, I duplicate that ‘Format’ and change the imageid and the Text according to the iteration I wanted in a script.

it would be a local script right?

It would be a local script, yes.

i dont really understand the path_to_instance and path_to_format.

They are paths: script.Parent is a path, game:GetService("ReplicatedStorage"):WaitForChild("Nice") is a path, etc…

would i just completely copy the script u sent, would it work?

It won’t, the script I sent is just an example, since, foremost, I do not know what you need to do or where the location of the objects are and as such I cannot do anything

i can send a bit of information

Do you already have the format?

what do you mean???

(Check this as well)

is that good?

You do not need to copy the name or assets like UICorner, I just used those names as an example, but if that is what you want then yes. The thing is what do you want to be modified? How do you want to display the models?

imma just have them displayed as images and also how would i make the script to display the models? i have a folder that broken models get sent to and that is in replicated storage

You are searching for a Viewport frame, you can find the documentation here:

A video which should (probably) help understanding or making a ViewportFrame: How To Use Viewport Frames | Roblox Studio - YouTube

alr i will change it to a viewport frame but what do i do with the script?