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

Why Do Some For Loops Have a "#"?

Frequently I've seen many For loops have this symbol before something like "game.Lighting:GetChildren()," making it "#game.Lighting:GetChildren()." I was wondering what the "#" has to do with any of this.

1 answer

✓ Accepted answer

Length

The # operator is the length operator, and gets the length of a table or a string. In most of these loops you're looking at, it's telling it to run the loop as many times as there are entries in the table.

If you're not sure about what I said, you should learn tables.

1 comment

0

Thanks!

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