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