I have to use the grammar ようによっては in the following sentence. The meaning in English is
Depending on how you treat me, I can be a gentleman or not.
My attempt is as follows, but I think it is partially incorrect.
僕は、君が扱いようによっては、優しくなるかどうか
How to fix it?