Please, could you clarify the problem? Say you want a 5 or a 6.
Do you mean that you will continue the roll the die until success regardless of the number? Or do you have an upper limit on the number of rolls?