If the target creature isn’t destroyed, most likely because it has indestructible, you won’t gain any life. The same is true if the target creature leaves the battlefield before this scheme’s triggered ability resolves.