Help with player removing event not working

Hello I’m trying to have a datastore that saves the playerws info when they leave the game however it doesnt work. I tried printing stuff inside the removing event but nothing prints. this is my code:

local users = {}

game.Players.PlayerAdded:Connect(function(plr)
	table.insert(users, {
		["name"] = plr.Name,
		["data"] = {}
	}
	)
end)


game.Players.PlayerRemoving:Connect(function(plr)
local DSS = game:GetService("DataStoreService")
	local RecordingsService = DSS:GetDataStore("Recordings")
	for i,v in pairs(users) do
		if v.name == plr.Name then
			RecordingsService:SetAsync(plr.UserId,
				{
					["Data"] = users.data,
					["Time"] = timestamp,
					["Date"] = date
				}
			)
		end
	end
end)

When I try to call the datastore it’s just nil.

You’re referencing the table “users” when trying to index data in your for loop, Instead of using the item of “users”, which in this case would be “v” from the for loop.

{
   ["Data"] = v.data -- users[i] = {player data}
}

hey I did this however It still doesnt work