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

Script only going once? Your title should be specific! Describe your problem concisely.

Help, I have this script that moves a car when it is anchored. It only moves once. How do I make it that it moves forever?

--something not to worry about

while true do
script.Parent.Parent:MoveTo(Vector3.new(1,0,0))
wait(0.1)
end

1 comment

0

Ugh, I give up. I'll just use unanchored cars. Sure they like to crash a lot. but it's the only option I can do

4 answers

✓ Accepted answer

You can do Vector3 + Vector3 like this:

while true do
script.Parent.Parent:MoveTo(script.Parent.Parent.PrimaryPart.CFrame.p + Vector3.new(1,0,0))
wait(0.1)
end

1 comment

0
  • Unable to cast CoordinateFrame to Vector3, line 2

add a "while loop" it will make it go on forever

4 comments

0

How?

0

I'm pretty sure there is already one?

0

I'm pretty sure there is already one?

0

lemme check something

Wait, it only goes to a specific location. How do I make it move on one axis?

2 comments

0

This shouldn't be a answer, it should be a question but you can do Vector3.new(1, newValue, 1) for example

0

I did that and it's still moving at that exact spot :(

The issue is that in the while loop, you are always moving the car to the exact spot. To make it move one direction, you should change the x, y, or z axis, depending on what direction. Please accept my answer if it helps out!

1 comment

0

But how?

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