How To Get A Random Number In Lua

[Solved] How To Get A Random Number In Lua | Lua - Code Explorer | yomemimo.com
Question : how to get a random number in lua

Answered by : adxm

local randomNumber1 = math.random(1, 10) --Returns a number between 1 and 10.
local randomNumber2 = math.random(10) --Also returns a number between 1 and 10.
print(randomNumber1, randomNumber2) --OUTPUT EXAMPLE: "6, 8"

Source : | Last Update : Tue, 05 Jan 21

Question : lua random number

Answered by : panda-44keuduevjat

local number = math.random(1, 10)
# change 1 to be the smallest possible number
# change 10 to the be the biggest possible number

Source : | Last Update : Wed, 25 May 22

Question : lua random numbers printing

Answered by : dl--an-abbreviation-of-my-name

local randomnumber = Math.Random(1, 10) -this is a random number between 1 and 10
local canprint = True
local count = 0
while canprint do --gonna loop when canprint is true Print(randomnumber) --gonna print random number wait(1) --waiting one sec count = count + 1 --gonna count to one. it will say that we have done it 1 time already if count == 10 then --if we print it 10 times it will count canprint as false canprint = false 

Source : | Last Update : Fri, 25 Feb 22

Answers related to how to get a random number in lua

Code Explorer Popular Question For Lua