Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

having trouble with a script to make my part move back and forth?

so i put 2 transparent non-colidable parts as point A and B and this is my script

Model = script.Parent
while true do
Model.slider:MoveTo(Model.B.Position)
wait(2)
Model.slider:MoveTo(Model.A.Position)
wait(2)
end

and it says this is my error

12:56:58.770 - MoveTo is not a valid member of Part
12:56:58.771 - Stack Begin
12:56:58.772 - Script 'Workspace.slider.Script', Line 3
12:56:58.772 - Stack End

but there is no part named "Part" in the model at all

i have a feeling im going about this all wrong... plz help

EDIT:

okay so i tried to move the points outside the model and changed my script to

Model = script.Parent
point = script.Parent.Parent
while true do
Model.slider:MoveTo(point.B.Position)
wait(2)
Model.slider:MoveTo(point.A.Position)
wait(2)
end

also the explorer basicly looks like this

(format: directory depth-name - type)

sliders - folder
-slider1 - folder
--slider - model
---script - script
---slider - part
-- A - part
-- B - part

still getting the same error

13:39:56.896 - MoveTo is not a valid member of Part
13:39:56.897 - Stack Begin
13:39:56.897 - Script 'Workspace.sliders.slider1.slider.Script', Line 4
13:39:56.898 - Stack End

9 comments

0

I think you are trying to move the model to itself.. try putting the a and b parts outside the model

0

i just tryed that still getting same error i edited the post to update it if u could look @ that

0

:MoveTo() is for models only, not parts.

0

o

0

i made the part into a model and still does not work..-_-

0

Did you set a primarypart on the model? If not, click the model, click “PrimaryPart” in the properties, and click a part you want to set as PrimaryPart.

0

use the lerp method instead of MoveTo

0

yes i did set the primary part

0

Use vector3

2 answers

MoveTo 's cannot be used in Parts; can only be used in Models .

This discussion is preserved as it was. New answers, comments, and votes are closed.