hope you would help me to understand
Forum
CS2D Scripts table index is niltable index is nil
3 Antworten 1
hope you would help me to understand
The table index is an identifier for an array to get a value.
For example:
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
a={} a[2]=4 --2 is the index b={} b[function() msg("hello") end]=true --function() msg("hello") end is the index c={} c["hello"]=2 --hello is is the index
When you get the error "table is nil" it's most likely that you used a variable for the table index.
1
awesome[player(id,"name")]=true
In this case, id could have been nil, player returns false or an empty string so that must not have been what caused the index to be nil.
@ Jynxxx: No, table usually means like a SQL table, which is not related to lua arrays.
1