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: How would you correctly index "NumPlayers"

Previous Thread :: Next Thread 
Vampyroteuthiss is not online. Vampyroteuthiss
Joined: 17 Jun 2010
Total Posts: 11541
05 Sep 2014 03:28 PM
You know, that value in Players?
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 03:30 PM
local numPlayers = game.Players.NumPlayers;
print(numPlayers);

Report Abuse
Vampyroteuthiss is not online. Vampyroteuthiss
Joined: 17 Jun 2010
Total Posts: 11541
05 Sep 2014 03:34 PM
Thats all? Alright.

And whats with the semicolon after the phrases? I know its in other languages like C++, lua too?
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 03:35 PM
its not needed in lua, just habits
Report Abuse
Vampyroteuthiss is not online. Vampyroteuthiss
Joined: 17 Jun 2010
Total Posts: 11541
05 Sep 2014 03:38 PM
Alright, I can tell you know more than lua then if its a habit. Thanks for the help!
Report Abuse
Tynexx is not online. Tynexx
Joined: 11 Jul 2012
Total Posts: 1559
05 Sep 2014 04:13 PM
or:

local numPlayers=0

for , v in pairs(game.Players:GetPlayers()) do
numPlayers=numPlayers+1
end


this is the badd way though
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