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

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

Asked by
Kblow1 53
6 years ago

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?

0
What the heck.. Is this to advanced for everyone? Someone help me... Kblow1 53 — 6y
0
not advanced. Maybe create the buttons without having to script it lol awesomeipod 607 — 6y
0
need to team edit for it to be easier awesomeipod 607 — 6y
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. Kblow1 53 — 6y
View all comments (2 more)
0
So you want to make a script that can make buttons just by typing in a few parameters? ThatPreston 354 — 6y
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? awesomeipod 607 — 6y

1 answer

Log in to vote
0
Answered by
hellmatic 1523 Moderation Voter
6 years ago

You can use a for loop:

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

Or, print them manually:

print(Buttons[1], Buttons[2])
0
I dont think your understanding what im trying to do.. Kblow1 53 — 6y
Ad

Answer this question