Shopify Plus - Scripts, Only Allow Coupon if Local Pickup is Checked

Hi!

We have a client who wants to give a discount to those who choose to local pickup. I said create a unique code and we can have that code only work when someone selects local pick up. Can you think of a script that would do this?

Thanks!