Merging Two Tables

I’m trying to merge two tables together but am unsuccessful. I think the reason why they
aren’t merging is because of the "."s that they have in their strings, if I remove those dots
they won’t work but if I keep them the tables won’t merge. Anyone know how to merge them?

for k,v in pairs(table.Merge( self.human1Voices, self.combine1Voices ) ) do

How exactly is it unsuccessful? What is the result you get and what is the result you want? What’s in the tables you are merging?

I don’t get a specific error but the 2nd will work but the 1st won’t (ie. the 2nd table will give the results it’s supposed to give but the 1st one doesn’t). The result is that the 2nd one will work whereas the 1st won’t (so I’m thinking that they aren’t merging properly) and I’m trying to get both tables to work/merge properly. I’m using the OpenAura HL2:RP voices tables.

1st one: self.human1Voices
2nd one: self.combine1Voices
-> These aren’t global (if that has any important meaning)


Table Merging:

(line 77 without the merging lua code)

[editline]27th November 2011[/editline]

Never mind I got it working, instead of trying to merge the tables I just repeated the same code but specified a different table.

to be honest all your saying is making no sense. so you want a table to go into another table? so the keys from the original table into the new table along with their values?

– Table merging example.

– The source table with keys and values.
SrcTable = {};
SrcTable[“Key1”] = “Value1”;
SrcTable[“Key2”] = “Value2”;
SrcTable[“Key3”] = “Value3”;

– The table the source table will be going into.
DestTable = {};

– The first argument is the destination the source table goes, the second argument is the source table.
table.Merge( DestTable, SrcTable);

– DestTable now looks like this:
DestTable = {
“Key1” = “Value1”,
“Key2” = “Value2”,
“Key3” = “Value3”

I’m still new with tables so I don’t know too much about the subject but what I do know
is that the tables are specified in different files and I figured out how to get it working.
(Read edit above)

Funny… Because I got it working about 10 minutes after posting the topic… -.-