The concept sounds easy but I have no idea where to start. Example
printed a random number between 1 and 10
Okay, firstly this is not a request site.
So, you will want it to actually be random, so we add this line.
math.randomseed(tick()) -- Generate random seed. math.random() -- Throw out first not-so random number, which is a known limitation of lua.
Now, we want to get a number within a range of other numbers, for example, between 1 and 10.
To do this we will use math.random()
and we will store it in a variable called range
.
range = math.random(1, 10)
Now we will print it to the console.
print(range)
Full Script;
math.randomseed(tick()) math.random() range = math.random(1, 10) print(range)
If you would like any more help, don't hesitate to ask. If I solved your problem, please hit the accept button of this answer.
Good Luck!
Closed as Not Constructive by minikitkat
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?