generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Object Value help?

Previous Thread :: Next Thread 
Wehttam664 is not online. Wehttam664
Joined: 02 Oct 2009
Total Posts: 767
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 is not online. 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
Wehttam664 is not online. Wehttam664
Joined: 02 Oct 2009
Total Posts: 767
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
Wehttam664 is not online. Wehttam664
Joined: 02 Oct 2009
Total Posts: 767
11 Dec 2011 04:09 PM
bump
Report Abuse
Penguine236 is not online. Penguine236
Joined: 13 Apr 2011
Total Posts: 1303
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
Wehttam664 is not online. Wehttam664
Joined: 02 Oct 2009
Total Posts: 767
11 Dec 2011 04:22 PM
Bump.
Report Abuse
Wehttam664 is not online. Wehttam664
Joined: 02 Oct 2009
Total Posts: 767
11 Dec 2011 05:00 PM
Bump again, Any help?
Report Abuse
xvgigakid is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image