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
 

Re: Choosing x amount of different random players

Previous Thread :: Next Thread 
Causticity is not online. Causticity
Joined: 11 Jun 2012
Total Posts: 530
01 Jan 2016 11:39 AM
I'm having an issue choosing any number of random players that are all different from the player list. http://pastebin.com/mXEYZag4 is my current code and it keeps returning the same players twice
Report Abuse
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
01 Jan 2016 11:43 AM
local p = game.Players:GetChildren()
local Players = {}
local random = {}

for i = 1, #p do
table.insert(Players, p[i])
end

for i = 1, 3, 1 do wait()
table.insert(random, Players[math.random(1, #Players)])
end

Maybe

The Legend of Heroes Sen no Kiseki
Report Abuse
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
01 Jan 2016 11:44 AM
local p = game.Players:GetChildren()
local Players = {}
local random = {}

for i = 1, #p do
table.insert(Players, p[i])
end

for i = 1, 3, 1 do wait()
local x = Players[math.random(1, #Players)]
table.insert(random, x)
table.remove(Players, x)
end


The Legend of Heroes Sen no Kiseki
Report Abuse
deedeedum is not online. deedeedum
Joined: 15 Jan 2007
Total Posts: 19
01 Jan 2016 11:47 AM
no

local plrs = game.Players:GetPlayers()

local chosen = {}

for i = 1,3 do
local n = math.random(1,#players)
local c = Players[n]
table.insert(chosen,c)
table.remove(Players,n)
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