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

How do i make a button popup for however many things are in a table?

Here is what i have

local Buttons = {
	{"Trap Queen", "272389607", 1}
}
local bh = Test:WaitForChild("ButtonHolder")

local function NewButton()
local Button = Instance.new("TextButton",bh)
Button.Size = UDim2.new(0,169,0,35)
Button.Position = UDim2.new(0,-3,0,#Buttons*Button.Size.Y.Offset)
return Button
end

local Button = NewButton()
Buttons[#Buttons+1] = Button

So i want to make a button for everything inside of "Buttons" tables. And the layout to be like so

{"BUTTON TEXT", "SONG ID", SONG PITCH}

How would i do something like this? So everytime i added a new button it would make a new button inside of the GUI frame?

6 comments

0

What the heck.. Is this to advanced for everyone? Someone help me...

0

not advanced. Maybe create the buttons without having to script it lol

0

need to team edit for it to be easier

0

No... You dont understand. I want it to create a button for a table. So i can just go back into the script. Add it then be done it will auto-create it.. Its called thinking smart and doing less work.

0

So you want to make a script that can make buttons just by typing in a few parameters?

0

okay. exact size of the frame? position of the frame? orientation? how many buttons can fit inside the frame so that it doesn't  cross the frame's borders? scrolling frame or regular frame?

1 answer

You can use a for loop:

for i = 1, #Buttons do 
	print(Buttons[i])
end

Or, print them manually:

print(Buttons[1], Buttons[2])

1 comment

0

I dont think your understanding what im trying to do..

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