Garry's Mod Wiki

player.Iterator

Description

Returns an iterator for all players on the server.

This will be quite a bit faster than player.GetAll, especially when using the break keyword.

Returns

1 function
Iterator function
2 table
Table of all existing Players.
3 number
Will always be 0. Start index?

Example

Example usage of this function.

for _, ply in player.Iterator() do print( ply ) end
Output: Prints out all players to the console.