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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: in pairs

Previous Thread :: Next Thread 
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jun 2012 08:59 PM
if you do something in pairs, does that mean your doing all of it in the same time? or wut.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
04 Jun 2012 09:03 PM
for var1, var2 in function, table do

end

That is the format, however, what we usually use is:


for i, v in pairs(table) do

end



pairs is a function that returns a function (next) and the same table:


for i, v in next, table do

end



"in" and "pairs" have nothing to do with each other.


And no, it follows an order, one at a time, just very fast, so it looks like its at the same time.
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jun 2012 09:04 PM
wut if you put a wait will it still be fast :3
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
04 Jun 2012 09:10 PM
It will wait x times the amount of items in the table, x being the time in the wait; If I have a table with 13 objects and my wait is 0.5 seconds, it will wait 6.5 seconds.
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jun 2012 09:11 PM
Oh wut...
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jun 2012 09:12 PM
what if i have

Stop(it)

in there

function Stop(please)
wait(2)
end
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
04 Jun 2012 09:16 PM
It will wait 2 times the amount of objects in the table. o:
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jun 2012 09:16 PM
-_-
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jun 2012 09:18 PM
WHAT IF THERES MATH STOPPING IT! :O

((((((2+4)+5)+2)+453)+653534534534543)+(script.Parent.Position.Y))
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
04 Jun 2012 09:18 PM
Math doesn't make a computer slower... Have you used a calculator?
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jun 2012 09:19 PM
Yes. Siri said Let me think: waited 2 seconds then said: 2
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