|
| 16 Jul 2014 04:46 PM |
I want test to be < to 3. But I get errors, how do I make this work?
local test < (1+2) if test == 1 then print ("True") elseif test == 2 then print ("False") elseif test == 3 then print ("Unknown") end
|
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:48 PM |
local test = (1+2) --you can only define variables by = if test > 3 then test = test - 1 print(test) end
Maybe that's what you want? |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:50 PM |
Oh, I think I got it it. So you can't have you're output state two if statements, right?
local test = (1+2) if test < 3 then print ("True or False") elseif test == 3 then print ("Equal") end
|
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:52 PM |
| You need to define an absolute value to the variable since a computer is dumb and needs you to tell it what to do. |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Jul 2014 04:54 PM |
| Math.random () could help with what you want to do. Search it on the wiki. |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:55 PM |
| I've seen scripts with that before, does that just output a random if value? |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:56 PM |
| num = math.random(1,3)--will pick a number between one and 3 |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:58 PM |
I saw the (), I think that's a function. I haven't got to those yet though. |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:59 PM |
math.random is a function, which returns a number between startnumber and endnumber
math.random(startnumber,endnumber) |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 04:59 PM |
| Thanks, I'm sure that I'll get to those soon. :P |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2014 05:00 PM |
| Functions are awesome! And the best part is that they're easy to learn about! :D |
|
|
| Report Abuse |
|
|