random number roblox studio

-- Generate a random number between 1 and 100 inclusive
local randomNumber = math.random(1, 100)
print("Random Number:", randomNumber)


  • math.random() is a Lua function used to generate a random number.
  • 1 and 100 are the parameters passed to math.random(), setting the range for the random number generation from 1 to 100 (inclusive).
  • local randomNumber is a variable declaration used to store the generated random number.
  • print("Random Number:", randomNumber) is used to display the generated random number in the Roblox Studio console.