look i tryed here
local number = math.random() *5 >3 print (number)
L--> false
why did it input: false? how can i finish my code?
Your code printed false because your number
variable was an expression. The math.random
function with no given arguments will return a randomized number between 0 and 1. You multiplied this by 5, then had the expression check whether or not it was greater than 3. Due to this, the variable turned into a bool datatype. If it was greater than 3 then it would be true, if it was less than 3 it would be false.
I think what you were looking for was an if
statement.
local number = math.random() * 5 if number > 3 then print (number) end