here's how I would do what I think you're trying to do
Code:
function SetTicketNumberToNil(name)
local new_name = {} -- use a temporary table
for k,v in name do -- iterate over every field in the table
new_name[v]=k -- just stick 'em in the new table
end
table.setn(new_name,table.getn(name)) -- might not be needed, but you can do this to be thorough
return new_name -- return the new table
end