Home / Lua / Tutorials / Intermediate / Iterators

Some of the functions in the API use iterator functions. These must be used with for statements.
As an example, if you want to use Server:GetPlayers, use the following syntax:
for player in Server:GetPlayers() do
	print(player)
end

See also