killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 23 Jun 2012 07:01 PM |
if key == "b" and row ~= 1 then stuff elseif key == "n" and row ~= 2 then stuff elseif key == "m" and row ~= 3 then stuff end
Or would I have to use if's on the last two?
key is KeyDown event, and row is a variable that can be either 1, 2, or 3. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 23 Jun 2012 07:08 PM |
| No, you can have an unlimited number of elseif's per if statement. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 23 Jun 2012 07:09 PM |
...And as soon as I read my post I realize it's stupidly worded.
I mean: What you have appears to be correct. |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 23 Jun 2012 07:18 PM |
Lol, thanks.
At first I was like "Well..." But then I lol'd |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 23 Jun 2012 07:19 PM |
| The only reason I was questioning it was because there were two tests that it needed to pass per if statement |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 23 Jun 2012 07:21 PM |
You can have unlimited tests per if statement.
Note:
a = true b = true
if a then print("a is true") elseif b then print("b is true") else print("Nothing is true") end
Will ONLY print "a is true," despite b also being true. |
|
|
| Report Abuse |
|
|