Something like this, where you set the target floor before running the method. This should run until you are at the desired floor.