Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make parts repeat their movement?

Asked by 10 years ago

Is there anyway for this script to repeat this action constantly? Help would certainly be appreciated.

p1=game.Workspace.Part1

for i=1,5 do p1.CFrame=CFrame.new(i,1,0) wait(0.5)

end

1 answer

Log in to vote
1
Answered by
Vathriel 510 Moderation Voter
10 years ago

Of course, you'd simply drop that in a while loop.

p1=game.Workspace.Part1
while wait() do
    for i=1,5 do 
        p1.CFrame=CFrame.new(i,1,0) 
        wait(0.5)
    end
end
Ad

Answer this question