From: Kujila Maltz
ll---something for both of these things? Thanks =D
float llFrand(float mag);
This is the main random number generator for scripting. As the function declaration suggests, it returns a float value based on the float value (mag) given to it. In practical terms this mean that if you want to get a random number between 0 and 5, you would call:
float number = llFrand(5);
If you need to get a number between 1 and 5, use this:
float number = llFrand(5) + 1;
If you actually want an integer (whole number) value instead, you will need to either typecast the return value or use a function that returns an integer based on a float or calculation such as:
integer llRound(float number);
For example:
integer number = llRound(llFrand(5) + 1);
So to apply this to a random delay, you will just need to do something like:
llSetTimerEvent(llFrand(5) + 1);
This will create a timer event that occurs every 1 to 5 seconds.