Question about Randomness
TheTinman
Member Posts: 74
Would this be a 15% chance for thie script to fire?
void main() { // Add the randomness if(Random(100) >= 15) { ExecuteScript("script_here", OBJECT_SELF); } }
0
Comments
Random can come out as 0 and you put greater than instead of less than.
Wouldn't it still just be: if (Random(100) < 15) ?
Or: if (Random(100)+1 <= 15)
The OP gives an 85% chance.
@ForSerious if(Random(99) <= 15) gives a probability of 16/99 which is roughly 16.2%
Would this also be a way to write it?