skript92
|
  |
| Joined: 23 Jul 2013 |
| Total Posts: 1430 |
|
|
| 13 Apr 2014 07:17 AM |
Is there any way that I can include a name with a space in a script? For example:
A = script.Parent.Right Arm <------ Can I?
while true do
A.CFrame = A.CFrame+Vector3.new(0,1,0) wait(0.2) A.CFrame = A.CFrame+Vector3.new(0,0,0)
end |
|
|
| Report Abuse |
|
|
skript92
|
  |
| Joined: 23 Jul 2013 |
| Total Posts: 1430 |
|
| |
|
skript92
|
  |
| Joined: 23 Jul 2013 |
| Total Posts: 1430 |
|
| |
|
Geodesic
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 998 |
|
|
| 13 Apr 2014 07:21 AM |
| A = script.Parent['Right Arm'] |
|
|
| Report Abuse |
|
|
skript92
|
  |
| Joined: 23 Jul 2013 |
| Total Posts: 1430 |
|
| |
|
Apocalyps
|
  |
| Joined: 15 Feb 2009 |
| Total Posts: 816 |
|
|
| 13 Apr 2014 07:23 AM |
No you cant do it like that, try this instead:
A = script.Parent["Right Arm"]
or
A = script.Parent:findFirstChild("Right Arm")
With the second one, you can also check if the part exists, like:
if A ~= nil then -- It exists! else -- It doesnt exist! end |
|
|
| Report Abuse |
|
|
Vermis
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 11501 |
|
|
| 13 Apr 2014 07:24 AM |
"No you cant do it like that"
yes you can |
|
|
| Report Abuse |
|
|
Apocalyps
|
  |
| Joined: 15 Feb 2009 |
| Total Posts: 816 |
|
|
| 13 Apr 2014 07:25 AM |
I was talking about this line:
A = script.Parent.Right Arm <------ Can I?
That piece of code will give an error |
|
|
| Report Abuse |
|
|