Datastore Question: Should I be using instances or a table value

Today, I have gotten confused over between datastores by saving by an instance value, so I wanted to figure out should I be using instances or tables, let me explain

Instance Method.

local Coins = Instance.New("IntValue",Leaderstats)
Coins.Name = "Coins"
Coins.Value = 100

local Gems = Instance.New("IntValue",Leaderstats)
Gems.Name = "Gems"
Gems.Value = 0

local ValueList = {
  ["Coins"] = Coins.Value;
  ["Gems"] = Gems.Value;
};

Table Method

local ValueList = {
  ["Coins"] = 100;
  ["Gems"] = 0;
}

Which Method Should I be using, and could have a better effect over a instance?

You cannot save physical Instances in a datastore, the table method seems fine.

I’m not trying to save physical Instances, I’m trying to save Instance.value

Ohh, yes that will work it’s pretty much the same as your table method except the values are inside a table, I would recommend the table method for what you’re doing.

1 Like

Both of them are identical. Coins.Value is the same thing as 100 because Coins.Value returns the current value, which is 100

1 Like

I do it with the table method, but both methods are fine.

1 Like