GetPlayers (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Legend26
Undo revision 49070 by Itunes89 (talk) This isn't deprecated.
>JulienDethurens
No edit summary
Line 1: Line 1:
<onlyinclude>{{Method
<onlyinclude>{{Method
|name = GetPlayers  
|name = GetPlayers  
|returns = [[Table]] ''list of players''
|returns = [[table]] <var>players</var>
|description = Gives you a table containing all the players in the server.
|description = Gives you a table containing all the players in the server.
|object = Players
|object = Players
Line 8: Line 8:
{{clear floats}}
{{clear floats}}


{{Example|<pre>
{{Example|<code lua>
for _,player in ipairs(game.Players:GetPlayers()) do
for _, player in pairs(game.Players:GetPlayers()) do
  player.Character:MoveTo(Vector3.new(0, 50, 0))
player.Character:MoveTo(Vector3.new(0, 50, 0))
end
end
</pre>}}
</code>}}


[[Category:Methods]]
[[Category:Methods]]

Revision as of 06:54, 26 January 2012

GetPlayers( )
Returns table players
Description: Gives you a table containing all the players in the server.
Member of: Players


Example

for _, player in pairs(game.Players:GetPlayers()) do player.Character:MoveTo(Vector3.new(0, 50, 0)) end