Here’s a picture that might help you. The box component would set a variable to a value of that on the opposite side. As the die rolls it’ll keep change the variable until it finally comes to rest.