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

need help fixing script ?

local list = {script.Parent.Frame1.FrameH.f3:GetChildren()}
for i = 1,#list do
	print (list[i].TextLabel.Name)
end

21:28:07.812 - Players.Player1.PlayerGui.ScreenGui.Script:3: attempt to index field 'TextLabel' (a nil value)

1 comment

0

The '{}''s are not necessary, for the 'GetChildren' method gets the current Children that are within the Parent [Parent:GetChildren()].

1 answer

✓ Accepted answer

Let's take a different approach to this. Use the generic for loop.

list = script.Parent.Fram1.FrameH.f3

for i,v in pairs(list) do
	print(v.TextLabel.Name)
end

1 comment

0

just removing the {} fixed it but thanks

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