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

[Solved] What does Team:GetPlayers() return if there are no players on that team?

What does Team:GetPlayers() return if there are no players on that team? I thought it would return nil, but it didn't seem to.

Solved with BlueTaslem's answer.

the code I used:

if next(game.Teams["Blue"]:GetPlayers()) == nil then

2 comments

1

An empty array.

0

Okay, thank you.

1 answer

✓ Accepted answer

The Wiki says it returns a list, so it will return a list. The list will just be empty.

Not all nothings are equal. It would be very inconsistent to return nil when an empty list {} perfectly represents the concept of "a list containing nothing".

1 comment

0

Ohhh, yeah. Thank you!

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