Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

4 comments

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"

0

can someone just close this question theres no point in the question being asked for the 50th time

0

I looked at the other questions multiple times. I still dont understand it.

1 answer

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

2 comments

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.

0

It is.

This discussion is preserved as it was. New answers, comments, and votes are closed.