So I know in C you can initialize an array by saying int arr[4]; which means an array of 4 elements but in lua is it the same case? so for example
local arr[4]
v=game.Players:children()
for i=1, #v do
arr[i] = 1+i
end
So in this case would it output arr[1] = 2, arr[2] = 3, arr[3] = 4, arr[4] = 5
Also can i put all the elements to one value like 0 in an array in LUA like this? arr[5] = {0}

5 comments
No, b/c "arr" requires to be a table to accomplish that; essentially you're telling the computer "set variable position # to # + 1," and not "set table position # to # + 1." The first would result in an error.
I'm confused by this question.
Ohh so basically you have to initialize it at the start. Welp thanks I thought i would be able to but owell
Learn the basics of BNF notation and consult the official Lua manual. Much faster than asking questions and gives you a fuller understanding of the language: https://www.lua.org/manual/5.1/manual.html#2.5.7
Lua or lua if you're lazy, but never LUA.