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
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 11 Sep 2014 08:02 AM |
| Use the :Moveto() method for models. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 11 Sep 2014 09:33 AM |
| Only problem with my suggestion is, it will be more like a jump. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 10 Jul 2008 |
| Total Posts: 1700 |
|
| |
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 11 Sep 2014 12:44 PM |
while wait (0) do
print(saduhsadjas)
\end |
|
|
| Report Abuse |
|
|