function getitems(plr) local holder = game.ReplicatedStorage:FindFirstChild(plr.Name.."'s Items Holder"):GetChildren() for i,v in pairs(holder) do if v.ClassName == "StringValue" then if v.Name ~= "Value" and v.Value ~= "" then local id = game.Players:FindFirstChild(plr.Name).userId itemDataStore:SetAsync(id..":items", v.Value) end end end end
local getitems = itemDataStore:GetAsync(newplayer.userId..":items") if getitems == nil then print(newplayer.." Has No Items!") else local newitem = Instance.new("StringValue") newitem.Name = getitems newitemValue = getitems newitem.Parent = game.ReplicatedStorage:FindFirstChild(newplayer.Name.."'s Items Holder") end
im trying to save multiple values in a folder in replicated storage but this current script only saves 1 of those values not all of them. im pretty new to datastore and scripting in general. any help appreciated TY.
You're trying to save each item individually which is overwriting it each time
Instead you should be putting all of the strings into a table and then save the table
when you load the table, simply loop through it and put it back into the folder