I'm creating a multiplayer game that allows multiple characters to be controlled by the same keyboard (Super Smash Brothers, essentially). As a result, I have the same set of variables for each character, and my code looks like this:
player1 = {
idle = true;
jumping = false;
-- Et cetera
}
player2 = {
idle = true;
jumping = false;
-- You get the idea, hopefully.
}
How might I be able to create the same effect without taking up a ton of script space? I would assume that for loops are the way to go, but is there any other way of doing it?

2 comments
Can you not just do table2 = table1? Same effect but doesn't need to loop through every value?
That would make table2 a reference to table1 and not a copy.