This is the code, I use a _G data system

function Save(player)
	local success, errormessage = pcall(function()
		if _G["Data"][player.Name] then
			GameData:SetAsync(player.UserId, _G["Data"][player.Name])
		end
	end)

	if success then
		print("Data saved for " .. player.Name)
		return true
	end
	
	print("Failed to save data for " .. player.Name .. ", retrying")
	Save(player)
	return false
end