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

generic loop problem?

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

1 comment

0

You don't need to put v.Value write just v, I think.

1 answer

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)..".")

2 comments

0

i changed this a little bit, its close but not exactly it

0

oh now i ALMOST have it i just need a way to space them

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