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: Simple question.

Previous Thread :: Next Thread 
churchdrummer2 is not online. churchdrummer2
Joined: 01 Aug 2011
Total Posts: 265
02 Sep 2012 11:10 PM
More like stupid question.. But what is the "for _," And so on? I have no clue what the name is-Let alone how to do it. Please send me the link from wiki if applicable.
Report Abuse
ThePurpleAngel is not online. ThePurpleAngel
Joined: 01 May 2012
Total Posts: 127
02 Sep 2012 11:25 PM
for [parent], [items] in pairs do

both names can be anything, its not have to be "__"
its a short cut for...

a=model:GetChildren()
for i=1,#a do
Report Abuse
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
02 Sep 2012 11:28 PM
@the purple, doing it wrong

for _, v in pairs(Workspace:GetChildren()) do it gets all of the children from workspace. You can change _ and v to anything you would like

~Don't get mad as to what I said, get mad at me as a person
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
02 Sep 2012 11:41 PM
tab = {"Hello","Hi","Hey"}
for i,v in pairs(tab) do
print(v)
end

Pretty much all that does is iterate through everything in the table and print it out. The i is the index and v is the value. If I said

print(i)

then it would print all the indexes in the table.
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
02 Sep 2012 11:43 PM
http://wiki.roblox.com/index.php/Function_Dump/Core_Functions%23pairs

~ Moo logic = logical logic ~
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