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
 

O.o

Previous Thread :: Next Thread 
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
21 Aug 2011 07:03 PM
~ #Parts == 5 ~


for i = 1, #Parts do
wait()
local Pos = Instance.new("BodyPosition")
Pos.D = 500
Pos.P = 600
Pos.position = Parts[i].Position + Vector3.new(math.random(-20, 20), math.random(-20, 20), math.random(-20, 20))
local Spread = game.Workspace["Game Global"].Spread:Clone()
Spread.Parent = Parts[i]
Spread.Disabled = false
Pos.Parent = Parts[i]
Parts[i].Parent = _G["Animations"]
end

Output: Running Script "Workspace.Animations.Part.Spread" (*50+)
Too much messages generated, discarding 223
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
21 Aug 2011 07:32 PM
Do not :clone() scripts.

~Ozzy
roblox.com/my/groups.aspx?gid=372
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
21 Aug 2011 07:45 PM
isn't it just much easier to run the scripts there?

for i=1,#Parts do
coroutine.create(coroutine.resume(function()
--stuff here
end))
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
21 Aug 2011 07:45 PM
Sorry I'm barely paying attention, watching the princess bride.

for i=1,#Parts do
coroutine.resume(coroutine.create(function()
--stuff here
end))
end
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
21 Aug 2011 07:47 PM
@above I love that movie.

Also: use generic for statement for tables.

~Ozzy
roblox.com/my/groups.aspx?gid=372
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
21 Aug 2011 07:49 PM
@Ozzy It's a classic :P

and I was just using his example.
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