How would I make a script that makes an IntValue for every value in a table?

Hey! I’m working on a datastore system for my game and I was wondering if I could make a script that makes an IntValue for every value in a table.
Here is what I mean:
Screenshot_1
How would I achieve this? Any help would be very appreciated!

Iterates through the loadedData and adds a intValue with money name with 0 value, then kills name with 0 value, ect.

local locationToAdd = --Place to add values
for i,value in pairs(loadedData) do
   local new = Instance.new("IntValue")
   new.Name = i
   new.Value = value
   new.Parent = locationToAdd
end
2 Likes

Thank you so much! This will save me a lot of time. :smile:

1 Like