How can I use math.random to get a number from multiple pools? I mean could I use it to get something between 1,3 and 6,9? Giving me 1, 2, 3, 6, 7, 8 or 9? I'm not quite sure how to explain this but it would be very useful
COMMUNITY QUESTION
How to get a bigger pool of numbers with math.random?
1 answer
I would use a table. The math.random idea I had in the comments might be done like this.
math.randomseed(tick())--seed
wait(math.rad(math.random(40,100)))--random waiting
nums = {
math.random(1,3), --nums
math.random(6,9)
}
num = math.random(1,#nums) -- full num
print(num) -- print num
Uses both a table and multiple randoms.
3 comments
0
Doesn't work...
0
Really? worked for me.... Is it a server script?
0
The problem comes in if I don't want the number 1. The issue is on line #10 I believe
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
Have two math.randoms?
No... I mean lets say I want A to = 1, 2, 3 6,7,8 or 9...
yea, use two math.randoms, or use a table
How would I use two math.randoms here? Explain..
I'll answer.
I'm closing this as a duplicate with a hopefully helpful answer. If you have a more specific question, feel free to ask that as a new question.