Create a specific number of frames based on a number

I’m trying to create a self check-in system for my airline. When the game starts it is gonna create frames of selectable classes based on a number i set in a module script. So if I set 6 in the module script it would create 6 of this frame. (I already have the code to create the frame) All I need is to have a loop for creating all these frames.

I currently have no code associated to this as I have no clue on how to do this. A simple script that loops through a number and creates frames according to that number. If possible also set a different name for each frame. So one is named “1” the second “2” and so on… Any help is appreciated!

You could name each of those frames in ‘1’, ‘2’, etc… or in unique names you choose.
Make sure you dont have any other thing named the same as them, before you clone/put them in the UI

And you can clone the gui for 6 times, but make sure when it has 6 of that, break/stop the loop/function.

The thing is I don’t know how to make the loop…

Could you possibly help me? Like with the loop…

1 Like

image
image
image

This is a very basic, and on the client, you can make a function like this on a module script [ edit it accordingly] and do your stuff.

1 Like

I can use this on the server right? To store it in a gui located in serverstorage that is opened by a proximity prompt later on.?

yo, ur script editor colours are really cool, can you send me a screen shot of the settings?

Of course you could do something alike on the server [ it’s safer and better].

You could put the decal in RS or what other serivce you’d like to.

I believe its one of the default themes, and this is off-topic.

Open up the roblox studio settings, you’ll find it there :
image

sry i know its off-topic but i rly want it. extra 2 is soemthing else can u send a screenshot of the colours

Another issue.
image
I’m trying to get a text label to say the name of the class from the module script. But this doesnt seem to work. Since they are named as “Class1Name” that would replicate to the first frame. But how would I do this? Do I have to change the name in Module or?

You could trigger the proximity with the player as the parameter, and then, you can clone the image/button/frame into a Player Gui’s list, notice : because it’s on the server, everyone technically would be able to see his frame that has been added into his gui.

I already got this sorted don’t worry.

image
image
image
image

1 Like
  1. I’d recommend working with ‘IsA()’ instead of ClassName.
  2. Could you send some screenshots?

The name of the label is className with a lowercase C i just wrote wrong in the script.

Main issue is to make this work

image

Module script has the name like this:

Try to remove ‘Name’ [which has a red line below], what errors does it print to you?

Did you requrie the module?

Players.AviaTeamm.PlayerGui.SCI.MainFrame.CheckInFrame.AttributeFrame.ClassFrames.5.ClassClient:14: attempt to index nil with ‘5’ It does this to everyone of the frames ‘1’ ‘2’ ‘3’