If the target creature is an illegal target by the time Sonar Strike tries to resolve, the spell doesn’t resolve. You won’t gain life even if you control a Bat.

Artwork
Loading artwork…
Sonar Strike
Bloomburrow · #32 · EN
Nonfoil—Foil—
Card rules
Sonar Strike deals 4 damage to target attacking, blocking, or tapped creature. You gain 3 life if you control a Bat.
Valley's midnight clerics channel the life force of other animals into blinding strikes and searing shrieks.
Common · Illustrated by Julie Dillon
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Tlr Legal
Vintage Legal
Future Not Legal
Old School Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions