local DSS = game:GetService("DataStoreService")
local saveitems = DSS:GetDataStore("ItemSaveSystem")



game.Players.PlayerAdded:connect(function(plr) -- whenever a player joins this will tell the game still save the inventory for players who joined after the first player updating the player list -- 
	wait(6)
	local players = game.Players:GetChildren()
	for i,v in pairs(players) do
		local items = v.gamepack:GetChildren() -- Inside of the gamepack is a bunch of Int Values, the things i want to save -- 
		for i,v in pairs(items) do
			v.Changed:connect(function() -- Whenever an int value is changed it needs to save to the datastore --
				saveitems:SetAsync(plr.UserId,v)
			end)
		end
	end
end)

I need to know how to make this data load into the players backpack, please help.

1 comment

0

You are putting events inside of loops, which is not okay.