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 do you make a random player selector?

Previous Thread :: Next Thread 
Greeny54321 is not online. Greeny54321
Joined: 26 Feb 2013
Total Posts: 38
19 Sep 2013 03:53 PM
How you make a random player selector?
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
19 Sep 2013 03:55 PM
You learn how to script.
Report Abuse
chicka123 is not online. chicka123
Joined: 05 Jul 2008
Total Posts: 25356
19 Sep 2013 03:55 PM
function generatePlayer()
local players = game.Players:GetChildren()
local player = math.random(#players)
return player
end
Report Abuse
Greeny54321 is not online. Greeny54321
Joined: 26 Feb 2013
Total Posts: 38
19 Sep 2013 03:56 PM
thanks
Report Abuse
Apatheia is not online. Apatheia
Joined: 16 Aug 2013
Total Posts: 198
19 Sep 2013 04:00 PM
No, that will return a number value, not a player value, you forgot to index it.

function generatePlayer()
local players = game.Players:GetChildren()
local player = players[math.random(#players)]
return player
end
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