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: Is there a way to make two parts move aat the samee time

Previous Thread :: Next Thread 
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 08:32 PM
i cant think of a way to do it but i was thinking it may have something to do with coroutines? if there is a way someone mind telling me?
Report Abuse
pauljkl is not online. pauljkl
Joined: 23 Oct 2008
Total Posts: 9364
27 Dec 2011 08:35 PM
Put no wait between them moving....

for i = 1,10 do
Workspace.PartA.CFrame = Workspace.PartA.CFrame*CFrame.new(1,0,0)
Workspace.PartB.CFrame = Workspace.PartA.CFrame*CFrame.new(-3,0,0)
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 08:40 PM
@Paul

yeah but its about 400+ randomly generated parts and I don't wanna have to do that for each part :U
Report Abuse
pauljkl is not online. pauljkl
Joined: 23 Oct 2008
Total Posts: 9364
27 Dec 2011 08:45 PM
They all move in the same way?
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
27 Dec 2011 08:46 PM
p = game.Workspace:getChildren()
for i=1,#p do
if p[i].Name == "NameOfPieces" then
local m = 1
repeat
wait(1)
m = m +1
p[i].CFrame = CFrame.new(m,0,0)
until m == 10
end
end

~Trappee?Trapper~
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 08:50 PM
@paul eh kind of
i put two in a set and for each set the two move toward each other
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
27 Dec 2011 08:55 PM
local model1 = workspace["Model1"]
local model2 = workspace["Model2"]

for i = 1, 10, 1 do
for i, v in pairs(model1:GetChildren()) do
if v:IsA("Part") then
v.CFrame = v.CFrame + Vecor3.new(bleh, bleh, bleh)
end
end
end

coroutine.resume(coroutine.create(function()
for i = 1, 10, 1 do
for i, v in pairs(model2:GetChildren()) do
if v:IsA("Part") then
v.CFrame = v.CFrame + Vecor3.new(bleh, bleh, bleh)
end
end
end

Easiest way.
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
27 Dec 2011 08:57 PM
I like mine better :3

~Trappee?Trapper~
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 08:59 PM
@dark you sure that would make them _all_ move at the _same_ time?

@trapper i dun think dat wuld work. . .
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
27 Dec 2011 09:01 PM
@Smurf, yes, just change the vectors to your liking.
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
27 Dec 2011 09:01 PM
local model1 = workspace["Model1"]
local model2 = workspace["Model2"]

for i = 1, 10, 1 do
for i, v in pairs(model1:GetChildren()) do
if v:IsA("Part") then
v.CFrame = v.CFrame + Vecor3.new(bleh, bleh, bleh)
end
end
end

coroutine.resume(coroutine.create(function()
for i = 1, 10, 1 do
for i, v in pairs(model2:GetChildren()) do
if v:IsA("Part") then
v.CFrame = v.CFrame + Vecor3.new(bleh, bleh, bleh)
end
end
end
end)
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 09:08 PM
u dun get wat i mean
i need them to move at the _same time_ not just appear to be moving at the same time because they all moved really fast
Report Abuse
pauljkl is not online. pauljkl
Joined: 23 Oct 2008
Total Posts: 9364
27 Dec 2011 09:09 PM
Well it does them in less than a frame...
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
27 Dec 2011 09:10 PM
THEY'RE MOVING AT THE SAME TIME.

Unless you have ultra vision and can see them moving at a frame, I honestly doubt anyone will be able to tell the difference.

Coroutines make the things run at the same time.
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 09:11 PM
but then doing that * 400+ *about 100*.03(wait()) = a few minutes
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 09:12 PM
"THEY'RE MOVING AT THE SAME TIME."

NO THEY'RE NOT

Please dun type in caps at me >.<
Report Abuse
Biostream is not online. Biostream
Joined: 28 Mar 2011
Total Posts: 913
27 Dec 2011 09:16 PM
Use coroutines.
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 09:18 PM
^
i wish i thought of that before
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 09:25 PM
messed up in mai math

but then doing that * 400+ about*100+.03(wait()) = too long to wait
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Dec 2011 10:57 PM
bump
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