If the target creature is an illegal target as Scriv's last ability tries to resolve, it won't resolve and none of its effects will happen. The Contract token won't be created.

Artwork
Loading artwork…
Scriv, the Obligator
Secrets of Strixhaven Commander · #9 · EN
Nonfoil—Foil—
Card rules
Flying, deathtouch
Whenever Scriv enters or attacks, create a white Aura enchantment token named Contract attached to target creature an opponent controls. The token has enchant creature and "Whenever enchanted creature attacks, it gets +2/+0 until end of turn if it's attacking one of your opponents. Otherwise, its controller loses 2 life."
2/3
Mythic · Illustrated by Brian Valeza
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Oathbreaker Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
In the rare case that the target creature is a legal target as Scriv's first ability resolves but the target creature can't legally be enchanted by the Contract token, the token won't be created at all.