The best practice now is to use the Random class like this:
1 | local rng = Random.new() |
2 | local r = rng:NextNumber( 5 , 15 ) |
You can optionally seed Random.new() with a seed value, useful when you want to test with the same random sequence.
You could use math.random() to get the same range, like this:
1 | local r = 5 + 10 * math.random() |
But there is no real advantage to this. math.random() internally uses the new Random class, but a global instance of it, and with additional overhead of a conditional to check a FFlag, and another branching to cover the cases where math.random(a,b) is expected to return an integer.
So, basically, don't use math.random. It was patched to use the new PRNG to improve the randomness in existing code (over the old C rand() implementation), but there is no reason to use it for new work.