Here's the finished product if anyone was interested. With Nillens help and a bit of help from the help files:
Code:
on *:text:!d*:#:{
  var %h = $right($1,-2)
  if %h < 0 { msg $chan $nick %h is not a valid entry. }
  if %h isletter { msg $chan $nick %h is not a valid entry. }
  else { msg $chan $nick rolled a ( $r(1,%h) ). }
}

Thank you Nillen!
Hope this helps anyone who needs it.