I have code with about twenty variables that all need to be equal to zero.

Example:

var1 = 0
var2 = 0
var3 = 0
var4 = 0
var5 = 0
-- Et cetera

Is there, maybe a use of a table that could restrict the number of lines (or anything else), or do I have to deal with it?

3 comments

1

local tab = {} for i=1,20 do tab[i] = 0 end Not completely sure what you're trying to do though.

0

Could I use in pairs as well? I tried it before but it didn't work properly.

0

Not necessarily since pairs would require an existing index value and a value to coexist with that value. The code I gave you will set up a new index value and set it equal to zero.