|
| 23 Feb 2015 09:03 PM |
I'm relatively new to scripting, and I was wondering...
How do you identify instances with spaces?
What I mean by this, is, say I want to do something with my right arm. I know you have to do something deeper then just saying
Player.Character.Right Arm
I know this is a very simple question, but I couldn't figure out the solution... |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2015 09:04 PM |
| Player.Character['Right Arm'] |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Feb 2015 09:16 PM |
You can also do this
Player.Character:FindFirstChild("Right Arm")
:FindFirstChild(string) is just a method to find an instance named after it's string, and returns true if found
btw join - http://www.roblox.com/My/Groups.aspx?gid=468509 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Feb 2015 09:18 PM |
Small tiny tip that might save you later: You have to use FindFirstChild if the name of your child is a property name of the object you are looking through. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2015 10:39 PM |
Another tiny tip that might save you later: FindFirstChild will return nil if the object is not found. Instance["Thing That Doesn't Exist"] will crash your program |
|
|
| Report Abuse |
|
|