First, I had made a data store for 10 values, and it worked fine and all in my place. I had sent it to someone else and for some reason, it only loaded one value. He had put everything in the right spot. I found it odd, and came here to find the answer to the question. Here is the code, I cut out the variables due to them looking like they did not need to be mentioned.

for i=1,10 do
	wait(.01)
local b = DataStore:GetDataStore("Inv"..i)
	b:UpdateAsync(key, function(oldValue)
		local newValue = oldValue or "None"
		local a = Instance.new("StringValue")
		a.Name = "ToolN"..i
		a.Parent = player
		a.Value = newValue
	end)
end

Yes, I stated player and key.

6 comments

0

where's the rest of the for-loop?

0

here

0

Since it doesn't seem like you're modifying the datastore, why not just use :GetAsync?

0

This would work.

0

Mind showing the whole script?

0

Alright