For future reference, please use Lua code formatting (the little Lua button above the text box on the editor.) when you post code. It makes it easier to see what's code and what's explanation.
It looks like you're trying to make a generic for loop using a numeric for style. This simply doesn't work.
First, pairs is a function, and it takes a Table as an argument. GetChildren returns a Table, but you have to call it as a method, using the : operator.
tostring(v) is unnecessary. print(v) will automatically call tostring() on v, since v is not a string.
Finally, and this is just a stylistic thing, unused return values (i in your code) are typically given an underscore (_) instead of a name, to indicate that they are not used.
for _, v in pairs(game.Lighting:GetChildren()) do
print(v)
end
1 comment
I do: for i,v in pairs(Game.Lightning:GetChildren()) do print(v.Name) end