creating a random number isn't that hard just set the number to round(random(1,Number)) , where number is the number inputted by the player..
but if you want the roll part in front of it, before being able to use the number typed, you should remove that part of the text and only use the number after converting it back to an integer..