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 » Scripters
Home Search
 

Re: What's the point in this?

Previous Thread :: Next Thread 
peaspod is not online. peaspod
Joined: 29 Sep 2010
Total Posts: 2809
25 Dec 2012 02:07 PM
What I don't get is that for i = 1, 10 do ..... is basically the same as for i, v in pairs (game.Players:GetPlayers()) do.

Example I wanna remove the tools in everyone's backpack

ex 1:

p = (game.Players:GetPlayers()
for i = 1, #p do
p[i].BackPackClearAllChildren()
end

ex 2:

for i, v in pairs (game.Players:GetPlayers()) do
v.BackPack:ClearAllChildren()
end

Basically the same but 1 less line of code. What specific thngs would you use pairs for which you wouldn't use the other "for loop" for?
Report Abuse
Aqualogy is not online. Aqualogy
Joined: 01 Dec 2012
Total Posts: 226
25 Dec 2012 02:08 PM
Scripting Helpers will help you.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
25 Dec 2012 02:19 PM
This will do it, but like many drugs, has side effects:

Instance.new("ManualSurfaceJointInstance")
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
25 Dec 2012 02:56 PM
>Trolling
>Respectable creator of games
>CHRISTMAS

Shame.

SHAME.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
25 Dec 2012 03:00 PM
">Respectable creator of games"

lol no
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
25 Dec 2012 03:13 PM
dude his games aren't bad
Report Abuse
oxcool1 is not online. oxcool1
Joined: 05 Nov 2009
Total Posts: 15444
25 Dec 2012 03:27 PM
[ Content Deleted ]
Report Abuse
noobertuber is not online. noobertuber
Joined: 16 Jan 2007
Total Posts: 2321
25 Dec 2012 05:10 PM
Pairs can be used for non-numeric (and non-consecutive) indexes.

-God Bless-
Report Abuse
Luc599345 is not online. Luc599345
Joined: 25 Jul 2008
Total Posts: 1169
25 Dec 2012 09:16 PM
None of the scripts you've wrote actually works. :/
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
25 Dec 2012 09:48 PM
For i = num1, num2 can do lots of things, it's basically to loop somthing for any amount of time, however if you did a for i, v in pairs(dndgnkfd) do

It would just repeat for amount of things within. Like

x = game.Players:GetChildren()

for i = 1,#x do

if x[i].ClassName == "Part" then

x[i]:Remove()

end

end

That would remove all the things within the player that has the classname part, how it does this is looping through it all and deleting 1 each loop, while

for i = 1,100 do
wait()
print("This Has Been Printed, "..i.." times!")
end

Would repeat the loop 100 times, then stop.

Woul
Report Abuse
cybris is not online. cybris
Joined: 01 Mar 2008
Total Posts: 2424
25 Dec 2012 10:38 PM
I think crouton was the only one who got what he was trying to say lol, he isn't spamming the forum, he has a question about scripting, so he is discussing it. He is not asking for help with a specific bit of a script, he just gave a general example to help us visualize the topic of discussion. He is asking what you would use "pairs" for that you would not use "for" for
Report Abuse
cybris is not online. cybris
Joined: 01 Mar 2008
Total Posts: 2424
25 Dec 2012 10:39 PM
Oh and nubertuber answered too :)
Report Abuse
oxcool1 is not online. oxcool1
Joined: 05 Nov 2009
Total Posts: 15444
25 Dec 2012 10:46 PM
[ Content Deleted ]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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