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 » Scripters
Home Search
 

how to count how many plrs r in server?

Previous Thread :: Next Thread 
jaki619 is not online. jaki619
Joined: 01 Jul 2014
Total Posts: 63
31 Aug 2017 08:47 AM
how i put a detector in a script tat detects how much players r in the game...like if there is 1 player then do this event..if there r 3 players..then do the other one...etc..
Thanks alot! and i appreciate any help :D
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
31 Aug 2017 09:05 AM
#game.Players:GetPlayers()

getplayers returns a table, # is the length operator


Report Abuse
wpled is not online. wpled
Joined: 28 May 2011
Total Posts: 413
31 Aug 2017 09:06 AM
print(#game.Players:GetPlayers())

local amount = #game.Players:GetPlayers()

if amount == 1 then
--do whatever
elseif amount >= 3 then
--do whatever
end



Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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