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: Help

Previous Thread :: Next Thread 
wackeyhd5cool is not online. wackeyhd5cool
Joined: 24 Nov 2010
Total Posts: 906
11 Dec 2015 07:46 PM
Can someone tell me how to make a script that adds players in the game to a table?
Report Abuse
spyspace12 is not online. spyspace12
Joined: 16 Nov 2012
Total Posts: 615
11 Dec 2015 07:48 PM
for i,v in ipairs(game.Players:GetChildren()) do

-- i for the index meaning number of items in the players folder
-- v for the actual player

end
Report Abuse
wackeyhd5cool is not online. wackeyhd5cool
Joined: 24 Nov 2010
Total Posts: 906
11 Dec 2015 07:48 PM
I tried:


PlayerZ = {} -- WORKS

function Added()
for i,v in pairs(game.Workspace:GetChildren()) do
if v:FindFirstChild("Humanoid") then
table.insert(PlayerZ,v)

end
print(PlayerZ[i])
end

end


Added()
Report Abuse
spyspace12 is not online. spyspace12
Joined: 16 Nov 2012
Total Posts: 615
11 Dec 2015 07:51 PM
PlayerZ = {} -- WORKS

function Added()
for i,v in pairs(game.Players:GetChildren()) do

table.insert(PlayerZ,v[i]) -- I think this should go down 1 by 1 since its v[i]

end
print(PlayerZ[i])
end

end

Added()
Report Abuse
wackeyhd5cool is not online. wackeyhd5cool
Joined: 24 Nov 2010
Total Posts: 906
11 Dec 2015 08:01 PM
Prints nil
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