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}
No, you can't.
Lua is designed to be a very lightweight language. This is why it omits a lot of quality of life features from other languages, like increments and the continue operator. This makes the instructions a VM needs to know very slim, giving it a huge performance boost.
One of the features it omits is declaring arrays (called tables in Lua) by a fixed length.
All tables are dynamic, and declared like so:
local t = {}
You can proceed to fill in your data in between the curly braces.