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 » Scripters
Home Search
 

Help with while loops!

Previous Thread :: Next Thread 
majoko1 is not online. majoko1
Joined: 31 Jan 2009
Total Posts: 22799
21 Feb 2015 06:21 PM
For some reason the stuff after the embedded loop won't run inside of the main loop. It's really strange and I can't figure it out.

--------------------------------------------------------

part = script.Parent

while 1 == 1 do

i = 0

while i ~= 13 do

wait(.25)
part.CFrame = part.CFrame * CFrame.new(-1,0,0)

i = i + 1

end

wait(.25)

part.Cframe = part.CFrame * CFrame.new(14,0,0)

wait(3)

end
Report Abuse
cosmo9512 is not online. cosmo9512
Joined: 20 Jun 2013
Total Posts: 1407
21 Feb 2015 06:25 PM
i don't think a loop can run inside another loop
Report Abuse
majoko1 is not online. majoko1
Joined: 31 Jan 2009
Total Posts: 22799
21 Feb 2015 06:26 PM
wow really? That's strange. I'm so used to C++ that I guess I just didnt realize
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
21 Feb 2015 06:29 PM
Yes loops can run in loops.
Report Abuse
majoko1 is not online. majoko1
Joined: 31 Jan 2009
Total Posts: 22799
21 Feb 2015 10:28 PM
Okay then what might be the problem?
Report Abuse
SurKipper is not online. SurKipper
Joined: 25 Dec 2011
Total Posts: 435
21 Feb 2015 11:07 PM
Do you want the to keep looping from the same spot? Because if so, I have a script that works for that.

part = script.Parent

while 1 == 1 do

i = 0

while i ~= 13 do

wait(.25)
part.CFrame = part.CFrame * CFrame.new(-1,0,0)

i = i + 1

end

wait(.25)

part.Position = Vector3.new(Put the parts position into here)

wait(3)

end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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