Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Random Variable

7 years ago

How could I set a variable to a random number 4-8?

Random Variable

7 years ago
%VARIABLE := 1D5 + 3

That means, you roll a five sided die one time and add 3 to that number. Your final result will have a minimum value of 4 and a maximum value of 8.

1 + 3 = 4
2 + 3 = 5
3 + 3 = 6
4 + 3 = 7
5 + 3 = 8

Random Variable

7 years ago

And if the maximum was 9? You wouldn't be able to add three and get...wait...1D6...

Alright, thanks for the help!

Random Variable

7 years ago
Yeah, you have the concept. Good luck.