You can use the provided random() or either() functions.
<<set $roll to random(1, 6)>>
<<set _roll to either(1, 2, 3, 4, 5, 6)>>
<<if $roll gte 4>>
<<if _roll is 6>>
do another thing
All things being equal, random() is easier to use in most cases, but I've heard either() is better if you only have a few values.
Note that variables starting with an _ are temporary, and get cleared on passage transition, but are better for your story when you only need a value for a bit.