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: Is :GetChildren() Broken for anyone else?

Previous Thread :: Next Thread 
wolf586 is not online. wolf586
Joined: 10 Jun 2009
Total Posts: 2773
24 Jun 2012 12:24 PM
Was making a new game yesterday and it always seemed to break at a point when I used :GetChildren().
The script worked when I was in PlaySolo and Start Server & Player.

Today I did a test with this:

p = game.Players:GetChildren()
m = Instance.new("Message")
m.Parent = game.workspace
while true do
for i = 1, #p do
if p[i] then
m.Text = p[i].Name
else
print("No Players")
end
end
wait(1)
end


and this did not work either.

Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
24 Jun 2012 12:26 PM
The script will run before the players enter and give you an empty table. To fix this, just put the `p = game.Players:GetChildren()` line inside the while loop.
Report Abuse
wolf586 is not online. wolf586
Joined: 10 Jun 2009
Total Posts: 2773
24 Jun 2012 12:28 PM
@rayoma, thanks, it seemed to have helped for the test. Ill come back with results if it works with my other place from yesterday.
Report Abuse
wolf586 is not online. wolf586
Joined: 10 Jun 2009
Total Posts: 2773
24 Jun 2012 01:04 PM
Ok, back with results. Some things didn't work, it only gave tools to one play, but an extra for i = 1,#p do before the event fixed it. Thanks again for you help :)
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
24 Jun 2012 01:06 PM
No problem. Thanks for being one of the few people who have the manners to say thank you. :)
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