generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Number of Players in Game

Previous Thread :: Next Thread 
Rapster2 is not online. Rapster2
Joined: 16 Oct 2009
Total Posts: 1865
24 Jan 2014 07:09 PM
How would I find out the number of Players in a game?
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
24 Jan 2014 07:10 PM
Game.Players.NumPlayers
Report Abuse
Astrain1 is online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
24 Jan 2014 07:11 PM
Try this:

playerCount = 0

for i,v in pairs(game.Players:GetChildren()) do
playerCount = playerCount + 1
end

print(playerCount)

~ You have 1 new message: Pancake. ~
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
24 Jan 2014 07:12 PM
Game['Players']['NumPlayers']

or

#Game:GetService('Players'):GetPlayers()
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
24 Jan 2014 07:12 PM
plrs = {game.Players:GetChildren()}
m = Instance.new("Message", game.Workspace)

for i,v in pairs(plrs) do
m.Text = "There are " return v.Value .. " players in the server"
end
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
24 Jan 2014 07:13 PM
@Goul That would error.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image