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

need help fixing script ?

Asked by 9 years ago
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)

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

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

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
0
just removing the {} fixed it but thanks Layfonex 0 — 9y
Ad

Answer this question