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

generic loop problem?

Asked by
Paldi 109
10 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

the problem is that it change the text to the same "v.Value" and i want it to change to all the childrens of "t" not just one of them

1local t = game.Workspace.Jobs:GetChildren()
2 
3for i, v in ipairs(t)  do
4while true do
5    wait(.1)
6    script.Parent.Text = "("..v.Value..", "..v.Value..", "..v.Value..", "..v.Value..", "..v.Value..")"
7end
8end
0
You don't need to put v.Value write just v, I think. XToonLinkX123 580 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Here's my solution, using table.concat and a secondary table.

1local Jobs=workspace.Jobs:GetChildren()
2local Names={}
3for i,v in pairs(Jobs) do
4    table.insert(Names,v.Value)
5end
6print("Jobs: "..table.concat(Names)..".")
0
i changed this a little bit, its close but not exactly it Paldi 109 — 10y
0
oh now i ALMOST have it i just need a way to space them Paldi 109 — 10y
Ad

Answer this question