I have a script that has a decent amount of children that I need to reference all of with variables, so I wanted to make it a little more efficient by having it automatically get all the children inside with a table and assign different variables to them. This is the script I have right now:
local cdn = script:GetChildren()
for i = 1, #cdn do
local child = cdn[i]
anim(i) = child
end
My issue is on line 4, it gives me an error saying "Expected identifier when parsing expression, got =", so what do I do to fix this?

4 comments
I believe you used parentheses instead of square brackets; this will cause the compiler to expect a function identifier.
I tried that and now I get an error for the anim part saying "attempt to index global 'anim' (a nil value)"
Have you defined the variable, "anim"?
No, I'm wanting "anim" to reference the different children inside the script, with anim1 corresponding to the first child, or anim7 corresponding to the seventh child, and so on.