Setting a random number is easy, saving that number is easy, displaying that number on the page is easy, but it might be overwhelming for you to do all at once if you don't understand how a variable works or any of the logic behind this stuff.
You should read the articles and play around with the editor a little to get a basic idea of what a variable is, that will help you do pretty much all the future things you want to do. But first, like I said, you should really focus on the actual writing. Adding a dice roll isn't going to keep a game from being unpublished, it needs to be a good story for that.