SavedVariables are bit tricky. It is not a simple table, it uses metatable and some default values.
In your case there will be always added key "version", so you have to be sure that you exclude this key from your count.
By the way if you want to get just values that are really present in table and not values returned from metatable use rawget(table, key).
EDIT:
If you want to make it simple, add subtable to your saved variables. Do not store items as RJ.Memory[itemData.itemId], but use something like RJ.Memory.data[itemData.itemId]. It will save you lots of troubles.
Last edited by Garkin : 05/15/14 at 07:24 AM.
|