Search
 
SCRIPT & CODE EXAMPLE
 

LUA

how to get a random number in lua

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"
Comment

lua random number

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

lua random numbers printing

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        
Comment

PREVIOUS NEXT
Code Example
Lua :: lua list of all keys 
Lua :: lua functions 
Lua :: roblox check if in private server 
Lua :: how to print a variable in lua 
Lua :: lua toggle 
Lua :: print a table in lua 
Lua :: lua calculator 
Lua :: Tool script example for lua 
Lua :: lua print table 
Lua :: lua string to binary 
Lua :: random number genarator 
Lua :: wails build 
Lua :: roblox create part script 
Lua :: how to add a damage decimal in roblox studio 
Lua :: enable http service roblox 
Matlab :: to detect if a data frame has nan values 
Matlab :: matlab not less than 
Matlab :: matlab if bigger than 
Matlab :: matlab switch figure 
Basic :: the terminal process failed to launch 
Basic :: visual basic non modal message box 
Elixir :: elixir timex format 
Elixir :: liveview component update 
Scala :: scala option 
Actionscript :: how to resize a base64 image 
Excel :: excel conditionally highlight rows based on column 
Perl :: perl add key to hash 
Pascal :: pascal pause until key is pressed 
Powershell :: install python command line windows 
Clojure :: clojure take-while 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =