|
| 07 Dec 2011 07:31 PM |
I'm new to the use of ObjectValues but it seem crucial to what I'm doing. The issue I'm getting is the fact that I've forgotten how to get the model it points to. ObjectValue.Value doesn't do it. Example: ___________________________________________________________________________
function findIfUnit(child) wait(0.1) if child.ClassName == "ObjectValue" then wait(0.1) TrainTime = script.Parent.TimeToTrain Unit = child.Value wait(TrainTime.Value) Unit.Parent = workspace Unit:MoveTo(script.Parent.FinishTraining.Position) --Line 7 script.Parent.PlayWork.Disabled = true script.Parent.Work1.Smoke.Enabled = false script.Parent.Work2.Smoke.Enabled = false end end script.Parent.ChildAdded:connect(findIfUnit) ___________________________________________________________________________
At about line seven, it says MoveTo is not a valid member of ObjectValue. I'm not trying to move an ObjectValue, I want the unit. Ideas? |
|
|
| Report Abuse |
|
|
micol2242
|
  |
| Joined: 13 Nov 2010 |
| Total Posts: 4732 |
|
|
| 07 Dec 2011 08:09 PM |
:MoveTo() needs two arguements
:MoveTo(Vector3, workspace.part) It has to move to a position, and a part.
--what is this i dont even-- |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2011 08:13 PM |
| Object Browser shows only one argument. It's not the MoveTo part, It's my newness to ObjectValues. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Dec 2011 04:12 PM |
@micol
MoveTo() doesnt have 2 arguments! where did you here that? I have used MoveTo() with just 1 argument. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 11 Dec 2011 05:04 PM |
@Penguine
I think he got confused and thought that
MoveTo(Vector3.new()) and MoveTo(Object.Position)
Were two diffrent arguments. |
|
|
| Report Abuse |
|
|
123mm
|
  |
| Joined: 11 Sep 2008 |
| Total Posts: 199 |
|
|
| 11 Dec 2011 05:06 PM |
| Really tahts odd, i have always Used MoveTo with Huamnoids with 2 args.... |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 11 Dec 2011 05:13 PM |
For some reason child.Value is being set to another ObjectValue.
For the record: :MoveTo() in any nonhumanoid takes 1 argument, a Vector3 position. :MoveTo() in a humanoid takes 2, a Vector3 position and a brick. |
|
|
| Report Abuse |
|
|