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

How do I take the first item on a table, and place it onto a textlabel's text?

Asked by 8 years ago

And so forth with however many more items are on the table?

1
label.Text = t[1] Tkdriverx 514 — 8y
0
*** I have multiple text labels named a - f. First item on the table should go in textlabel a's text, #2 into text label b's text, etc. Ethan_Waike 156 — 8y
0
You're able to edit your question to include additional information, so you know. adark 5487 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

Rename your TextLabels something like 't1', 't2', up to however many you need, so it's easier to get the number.

local gui = script.Parent
local a = {} -- insert your stuff here

for i = 1,#a do
    local find = gui:FindFirstChild("t" ..i)
    if find then
        find.Text = a[i]
    end
end
Ad

Answer this question