Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 28 Jul 2011 11:29 PM |
"if Player.Character and Player.Character:FindFirstChild("Torso") and Player.Character.Torso.Position.y < 100"
RBX.Lua doesn't work like that. If Character or Torso don't exist your script breaks.
if workspace:FindFirstChild"adsf" and Workspace.asdf.Name == "asdf" then print"asdf" end
breaks. |
|
|
| Report Abuse |
|
|
Aaaboy97
|
  |
| Joined: 05 Apr 2009 |
| Total Posts: 6612 |
|
|
| 28 Jul 2011 11:33 PM |
@Arceus
Don't you know how Lua if-statements work?
if < condition1 > and < condition2 > ... then
If condition1 is false/nil, it does not evaluate condition2, so therefore it will work. |
|
|
| Report Abuse |
|
|
| |
|
Aaaboy97
|
  |
| Joined: 05 Apr 2009 |
| Total Posts: 6612 |
|
|
| 28 Jul 2011 11:39 PM |
Workspace.asdf.Name == "asdf"
I lol'd. |
|
|
| Report Abuse |
|
|
Aaaboy97
|
  |
| Joined: 05 Apr 2009 |
| Total Posts: 6612 |
|
|
| 28 Jul 2011 11:41 PM |
@Arceus
Also, it's a typo that breaks your script.
if workspace:FindFirstChild"adsf" and Workspace.asdf.Name == "asdf" then print"asdf" end -------------------------------^adsf------------------^asdf |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|