Talk:Rand

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

How do I add a random number of items with this script?

Like player.additem 0000000f <rand function>

How would i do that?

Easily. Although you may not be able to use this in the console, and the example you gave looks like it was a console command, not a script.

Short randNum Set randNum To rand 0 [max] player.additem <item id> randNum

Between or between and?[edit source]

A short question dose rand 1 10 return any number bigger than 1 and less than 10 or does it also include 1 and 10?

As it returns a float value with quite a few decimal places, it pretty much doesn't matter. The difference between stopping at 9.999999 and 10 is marginal, and won't affect the odds in any meaningful way. Just be sure to check like < 2, < 3, < 4, and so on, rather than ==1, ==2, etc.
Dragoon Wraith TALK 20:31, 18 February 2009 (EST)