PDA

View Full Version : Randomise a value?



Bopoo
05-22-2008, 12:35 PM
Is it possible to randomise a value? I'm just learning lScript and decided to make a basic building generator and im trying to make it so that the offset of a bevel is random so that they aren't all the same height. Thanks for any help.

papou
05-22-2008, 07:10 PM
http://www.mikegreen.name/Lscript/Lscript%20Index.html


random
The random() function generates pseudo-random integer numbers. It can either accept two numeric integer values—which returns a random integer number that lies between those two numbers (inclusive)—or it can accept two floating-point numbers— which will generate a floating-point number that lies between those numbers. Numbers can be negative or positive.

triggerFrameInt = random(20,50);
triggerFrameFloat = random(20.2, 50.2);