Engulfing Slagwurm‘s ability triggers whenever it blocks or becomes blocked by a creature. (As mentioned in a previous rules tip, this ability will trigger once for each individual creature that blocks it or for each creature it blocks.) When this ability resolves, the specific blocked or blocking creature is destroyed and the controller of the Slagwurm will gain life equal to the toughness of that creature.
It is important to note that the blocked or blocking creature does not have to be destroyed by the ability in order for life to be gained. For example, if an attacking Engulfing Slagwurm is blocked by a Cudgel Troll and before this triggered ability resolves the Troll’s regeneration ability is used, the Troll will not be destroyed. However, the controller of the Slagwurm will still gain three life, as this life gain is not contingent on a creature being destroyed.
Somewhat similarly, if the blocked or blocking creature leaves play before this triggered ability resolves the game will use last known information to calculate how much life will be gained. In other words, the toughness of the appropriate creature when it was last in play will be used to calculate what life is gained.