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
 

Re: Moving parts at the same time

Previous Thread :: Next Thread 
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
11 Sep 2014 07:43 AM
I want every children from a model to move +5 studs up smoothly, but I can't get them to move at the same time. Only one at a time.

for _, part in pairs(model:GetChildren()) do
local a = 0
repeat
part.CFrame = part.CFrame+Vector3.new(0, 1, 0)
a = a+1
wait()
until a == 5
end


I have knew all the time when making the script that it will move one at a time and have tried to fix it without result.

Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
11 Sep 2014 08:02 AM
Use the :Moveto() method for models.
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
11 Sep 2014 08:03 AM
Also your script would work if you removed the wait().
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
11 Sep 2014 08:04 AM
I don't want it to 'teleport' to a position.

I want it to go smoothly up until "a" reaches 5.
Report Abuse
LordNurgle is not online. LordNurgle
Joined: 28 Jun 2009
Total Posts: 326
11 Sep 2014 09:32 AM
Try this.

part = game.Workspace.moveMe:GetChildren()--change to your model

for i = 1,#part do
local a = 0
repeat
part[i].CFrame = part[i].CFrame+Vector3.new(0, 1, 0)
a = a+1
until a == 5
end
Report Abuse
LordNurgle is not online. LordNurgle
Joined: 28 Jun 2009
Total Posts: 326
11 Sep 2014 09:33 AM
Only problem with my suggestion is, it will be more like a jump.
Report Abuse
Ultraw is not online. Ultraw
Joined: 20 Nov 2010
Total Posts: 6575
11 Sep 2014 10:08 AM
WHY DOES NOBODY EVER KNOW THE

Model:TranslateBy()

METHOD??


In your case:

model:TranslateBy(0,1,0)
Report Abuse
Ultraw is not online. Ultraw
Joined: 20 Nov 2010
Total Posts: 6575
11 Sep 2014 10:09 AM
Or smoothly


for i=1,10 do
wait(0.1)
model:TranslateBy(0,0.1,0)
end
Report Abuse
Ultraw is not online. Ultraw
Joined: 20 Nov 2010
Total Posts: 6575
11 Sep 2014 10:12 AM

sorry, 5 studs

for i=1,50 do
wait(0.1)
model:TranslateBy(0,0.1,0)
end
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
11 Sep 2014 10:12 AM
Used repeat for it, but ty.

I did read something from it, but didn't understand to use it.
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
11 Sep 2014 12:14 PM
Try using coroutine?
Report Abuse
K7Q is not online. K7Q
Joined: 23 Mar 2013
Total Posts: 5546
11 Sep 2014 12:44 PM
while wait (0) do

print(saduhsadjas)

\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