I am seemingly unable to insert a key into a dictionary

So i have been trying to insert keys into a dictionary via scripts however it seemingly isn’t able to actually insert it based on a print function I have that prints the contents of the dictionary. And it prints out nothing, the dictionary is empty for some reason.

The reason as to why I’m doing this is because I want to save the amount of uses an item has left when the player leaves. And i want to save that uses value specifically and somehow link it to the item so i can be able to load it into the item.

for i,trinket in pairs(trinkets) do
        trinketusevalues[trinket.Name] = trinket.Amountleft.Value
end

Can you please add print statements within the for loop, to confirm that it is looping correctly

So i somehow managed to fix it. I do not know why it did not work earlier but its fixed now i guess.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.