Depend how you have done your control.
If you have it only in “player controller” then just do other for when they are in ladder.
If you have the controls in your player blueprint, then do a check.
So when the player overlap a ladder and press a button, change how your controls work. In this case W just will increase your Z and S will decrease your Z.
If you still don’t have practice with overlap events, practice it first, later practice how to change controls and finally you will have this