The first question is.. what are you trying to accomplish.
The first example looks like you'd get the folllowing:
You have name, which you populate with numerically indexed names of the members in the raid. So if its you and I.. we'd be:
Code:
name = {[1] = "Cladhaire", [2] = "Shouryuu"]}
Then your code does something that I'm not understanding. You go through and set the table to the following:
Code:
name = {[1] = nil, [2] = nil};
Because name[v] doesn't have a value. if you're looking to make a double-reverse-lookup table, you can use:
Code:
function SetTicketNumberToNil()
for k,v in name do
name[v]=name[k]
end
end
But I'm not sure exactly what you're looking for. My code would give you:
Code:
name = {
[1] = "Cladhaire",
[2] = "Shouryuu",
["Cladhaire"] = 1,
["Shouryuu"] = 2,
};