game.Players.PlayerRemoving:connect(function(m)local S=(game:GetService("\068\097\116\097\083\116\111\114\101\083\101\114\118\105\099\101")):GetDataStore(m.Name.."\083\116\097\116\115")local P=(m:FindFirstChild("\068\097\116\097")):GetChildren()for m=1,#P,1 do S:SetAsync(P[m].Name,P[m].Value)print("\115\097\118\101\100 \100\097\116\097 \110\117\109\098\101\114 "..m)end print("\083\116\097\116\115 \115\117\099\099\101\115\115\102\117\108\108\121 \115\097\118\101\100")end)
--[[
	By
	  Precious
	          Beam
--]]
game.Players.PlayerRemoving:connect(function(player)
	local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name .. "Stats")

	local statstorage = player:FindFirstChild("Data"):GetChildren()
	for i = 1, #statstorage do
		datastore:SetAsync(statstorage[i].Name, statstorage[i].Value)
		print("saved data number " .. i)
	end
	print("Stats successfully saved")
end)
