✓ Accepted answer
The # returns the length of a table or string. Example:
local words = {"Hi", "Hello", "How are you"}
print(#words)
local word = "Octopus"
print(#word)
Now, the i is just the name for the variable. It can be anything.
But overall what the script does is if the humanoid is equal to the parameter provided, it will return the player.
Going back to the #words thing. To access a specific item in a table, you get it from its place in the table. As you can see, the first item in the table was "Hi". So if we do this:
print(words[1])
What the "for i = 1, #players do" part is doing is looping through the "#players".
The i goes from number 1, to how many players are in the server. The players[i] is the player. "i" being their number in the table. Hope it helps.
1 comment
Thank you so much!