Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Im trying to figure out i,v in pairs()? I cant figure out anything with it

Asked by 5 years ago

What are you able to put inside of the () other than getchildren or tables? Anything specific?

1
This is a question that has been answered a ton of times and can be explained via a google search. You're bound to find a better answer there than to have someone re-iterate what you can find. Literally search "for i,v in pairs" Azarth 3141 — 5y
0
can someone just close this question theres no point in the question being asked for the 50th time dualworlds 90 — 5y
0
I looked at the other questions multiple times. I still dont understand it. iiBuilder_Boy 27 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

for ex this script would kill all the players. inside the pairs parameter you would insert a table, and v would be representing all the members of that table. So right now, v is representing all of the instances under the property of 'Players' Hope this helps!

for i,v in pairs(game.Players:GetChildren()) do
v.Character.Humanoid:TakeDamage(100)
end
0
I knew that but I don't want to not use the in pairs. I'm confused by what you can put in the (). I know you can use getchildren and tables in it. But I don't know if thats the only thing you can put in it. iiBuilder_Boy 27 — 5y
0
It is. http_shawn 1 — 5y
Ad

Answer this question