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"

3.33
6
Firey_ 70 points

                                    local M = math.random(1,2) --Input you number

print(M)

3.33 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how random works in lua what is random.new lua how ot randomjze a number in lua math lua random custom math.random lua lua get random name random integer lua random number between lua lua random int lua choose random lua math.random(1, 1) generating random numbers in lua lua random.new how to make a random number in lua lua random numbe math random objects lua lua generate random number with length how to choose random number in lua random value lua lua math random lua example random int lua math.randmo random lua .random lua randopm number in lua how to get a random value in lua how to get an random number in lua random number string lua lua random string and numbers lua get random number making own random funtion lua lua math.random generate random number lua how to pick a random number in lua roblox lua math.radom math.random number lua lua generate random int random number generator lua code lua return random number random number generator lua how to make a random generator in lua get random number ibn lua lua random numbers how to random lua how to do random number in lua how does a math.random function work lua set random to number lua lua math.randomseem lua math.random (1,2) lua math.random (1,2 lua random integer random number in lua random function lua math randomseed lua lua randomise variable get random number lua math.max lua lua min lua random seed how to generate a random number in lua math.sqrt lua math pi lua math.cos lua lau math.random lua pi math lua lua get a random id lua math sin pick a random number between two numbers lua how to generate a random adress in lua how to generate a random code in lua lua math.floor lua math.random string lua randome math.sin lua lua generate random integer math.random() lua random int lua how to choose a random item from a table lua how to get a random number in lua lua math.huge lua math.randomseed better lua math library lua generate random number math random seed lua long strong generator luia math.huge lua creating random numbers in lua lua random number generator lua math acos lua math.random() lua random number lua random function math.rad lua math.random in lua math.randomseed lua random number counter lua random numbers in lua how to get random numbers in lua lua cosine lua math.cos lua rando lua math functions math() lua Lua math. math random lua random lua code lua min max random in lua lua math random 10 per 10 lua math randomround how to make random in lua how to make a random number lua lua math library lua log math lua math fucntions lua random lua math random number lua lua random value math.random lua random lua code genorator lua math.random
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source