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

What does i and v mean?

Asked by 9 years ago

Sorry, but I couldn't find anything anywhere telling me what i and v mean in scripts. Can you guys help?

0
i is index and v is value XToonLinkX123 580 — 9y
0
This Question has been answered multiple times; please use the Scripting Helpers' Search Engine to search for existing Questions. :) TheeDeathCaster 2368 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago
for I,v in pairs(game.Players:GetPlayers()) --The Value is all the players in the game and the players property.
      v:remove() --Kicks all the players in your server. So preety much like a shutdown script.
end
0
Oh! I get it! Thanks! But, what's i for? I get what V does now. james24dj 90 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

I'll add on to what has been said above.

The pairs or ipairs function calls information from a table you have already made.

For example:

t = {1,2,"a","d",c = 12, q = 20} -- your table
for i,v in pairs(t) do
    print(i,v)
end

This would output to:

1 1
2 2
3 a
4 d
c 12
q 20

i and v are variables so you can change them to whichever you wish.

Answer this question