I am trying to make a script, that get's every StringValue in game.ServerStorage.Testing
, but every time I run the script it tell's me this error. attempt to index field 'Parent'
(a nil value) Anyone have a idea on how I can fix it?
a = game.ServerStorage.Testing:GetChildren() for v = 1,#a do local t = script.Parent.Parent.Parent.Script.temp:Clone() t.Name = v.Name t.NameT.Text = v.Name t.Position = UDim2.new(0,10,0,(t*35)) t.Parent = script.Parent.Parent.Parent end
Hi, ISellCows.
The problem with your script is that you are trying to get the name of v
(a number value), Instead of getting the name of a[v]
(the object)
If you're too lazy to read what I said above, I wrote you a more efficient version.
a = game.ServerStorage.Testing:GetChildren() for _,Object in pairs(a) do local t = script.Parent.Parent.Parent.Script.temp:Clone() t.Name = Object.Name t.NameT.Text = Object.Name t.Position = UDim2.new(0,10,0,(t*35)) t.Parent = script.Parent.Parent.Parent end