I’m trying to change the name of an index inside of a dictionary.
Example:
local Dictionary = {
["Item"] = 1234
}
How can I change Item
to Number
?
I’m trying to change the name of an index inside of a dictionary.
Example:
local Dictionary = {
["Item"] = 1234
}
How can I change Item
to Number
?
I want to tranform ["Item"] = 1234
over to ["Number"] = 1234
You can’t directly change an index in a table generally. You would have to insert a new entry and remove the previous entry that you desired to be changed:
Dictionary.Number = 1234
Dictionary.Item = nil
I was thinking of doing something like that, but didn’t thinking there was an easier way. Thank you very much, cheers!