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
9 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

local t = game.Workspace.Jobs:GetChildren()

for i, v in ipairs(t)  do
while true do
    wait(.1)
    script.Parent.Text = "("..v.Value..", "..v.Value..", "..v.Value..", "..v.Value..", "..v.Value..")"
end
end
0
You don't need to put v.Value write just v, I think. XToonLinkX123 580 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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

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

Answer this question