A Random Feature


:pray: please be activated soon


So excited, I hope they activate it soon!


Any thoughts on being able to hop to a specific integer or number instantly instead of calling :NextNumber() or :NextInteger() a lot of times? I’m working on a slide generator with different obstacles, some of which require warning signs earlier on in the slide. I’m generating the slide on the fly and I want to know beforehand when certain obstacles should spawn (depending on random values). If I can just hop a few steps forward/backwards at once it would make things a lot more convenient.


Either tomorrow or early January.


Call :NextNumber() or :NextInteger() a bunch of times in advance, and store the results to a table. This is probably the fastest way to do it at the moment.


You could just use the noise function for something like that which would be easier. and you likely wouldn’t notice a difference if you “zoom out” enough with it


In time for Christmas? :smirk:


“In observance of the gift-giving season”



Ehh. Oh. Thanks.


This is now live.


Question about NextNumber(), technically, does it include the min, and approach the max?


Found a minor quirk:

while wait() do
    local R = Random.new(-tick())

will print the same number for one second, until the seed changes.

I think that is expected as it’s not exactly the right way to use it, but…


Yeah, notice the interval notation:

Closed at min, and open at max, so min <= x < max


Yeah, the range is [min,max).


You don’t get the title, hmm?

It’s quite literally random


So in the example:

rng:NextNumber(0, 255)

Does this mean that you will never get 255 as a value?


Since we’re talking about floats, not ints, would it really matter?


That’s correct, you’ll never hit 255.


Why not include the end value for NextNumber and make it consistent with how NextInteger works?