GetPlayers (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
No edit summary
>Camoy
No edit summary
Line 9: Line 9:


{{Example|<pre>
{{Example|<pre>
local players = game.Players:GetPlayers()
for _,player in ipairs(game.Players:GetPlayers()) do
 
   player.Character:MoveTo(Vector3.new(0, 50, 0))
for i = 1, #players do
   players[i].Character:MoveTo( Vector3.new( 0, 50, 0 ) )
end
end
</pre>}}
</pre>}}


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

Revision as of 23:10, 28 February 2011

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


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