sgroup = {} ggroup = {} lgroup = {} tgroup = {} f = game.Lighting.Npc.Bot --print(f) g = f:Clone() gps = g:GetChildren() g.Parent = game.Workspace game:GetService("RunService").RenderStepped:Connect(function() for _, v in pairs(sgroup)do if v:IsA"Part" then --while wait() do --for i=1, 2 do v.Transparency = v.Transparency + .04 --end end end end) table.insert(sgroup,1,gps)
The error is saying that sgroup is nil (the list is empty), and that you can't call the method :IsA
on a nil value.
sgroup = {} ggroup = {} lgroup = {} tgroup = {} f = game.Lighting.Npc.Bot --print(f) g = f:Clone() gps = g:GetChildren() g.Parent = game.Workspace game:GetService("RunService").RenderStepped:Connect(function() for _, v in pairs(sgroup)do if v ~= nil and v:IsA('Part') then -- added a v ~= nil which checks if v is not nil --while wait() do --for i=1, 2 do v.Transparency = v.Transparency + .04 --end end end end) table.insert(sgroup,1,gps) -- make sure that this is a instance your inserting in sgroup and that it has a ClassName so ':IsA()' can determine if it's a part