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
 

for loop + MoveTo()

Previous Thread :: Next Thread 
Secretiverobocop is not online. Secretiverobocop
Joined: 23 Apr 2011
Total Posts: 510
28 Apr 2012 06:57 PM
So in my place you look out a window into outer space One in a while a space ship will pass by the window.. (obviously a "while true do") Now I know how to move the spaceship.. but how could I use the for loop to increase the MoveTo() coordinates by 1 increment on, the x axis

game.Workspace.Plane1:MoveTo(Vector3.new(x,y,z)) --This is what I know..

Here is my attempt:


Plane1 = [THE SPACESHIP]

while true do
for i = 1, 100 do
game.Workspace.Plane1:MoveTo(Plane1.Position * Vector3.new(1,0,0))
wait()
end
end

My attempt most likely is inacuurate.. any help?
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
28 Apr 2012 07:10 PM
+ not *
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
28 Apr 2012 07:37 PM
use `:TranslateBy` instead.

    for i=1,100 do
        workspace.Plane1:TranslateBy(Vector3.new(1,0,0));
        Wait();
    end
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