If the target creature is an illegal target as Locutus's last ability tries to resolve, it won't resolve and none of its effects will happen. You won't gain life.

Artwork
Loading artwork…
Locutus, the One Who Speaks
Star Trek · #576 · EN
Nonfoil—Foil—
Card rules
Artifact creatures you control get +1/+1.

, Discard this card: It deals 2 damage to target creature. You gain 2 life.
1/1
"The knowledge and experience of the human, Picard, is part of us now."
Uncommon · Illustrated by Ariel Orea
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Future Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions