bluehead
|
  |
| Joined: 12 Aug 2007 |
| Total Posts: 158 |
|
|
| 12 Aug 2011 07:09 PM |
only show the last player that comes into the game?
while true do wait() local children = game.Players:GetChildren() for i = 1, #children do script.Parent.Text = (children[i].Name) end end
Can someone fix it please... |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 07:11 PM |
| What do you want it to do? |
|
|
| Report Abuse |
|
|
bluehead
|
  |
| Joined: 12 Aug 2007 |
| Total Posts: 158 |
|
|
| 12 Aug 2011 07:12 PM |
I want it to show on a TextLabel all the people in game. I am trying to learn how to use GetChildren. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 12 Aug 2011 07:13 PM |
| It shows them all. One at a time, going down the list in absolutely no time at all, ending as the last one. |
|
|
| Report Abuse |
|
|
bluehead
|
  |
| Joined: 12 Aug 2007 |
| Total Posts: 158 |
|
|
| 12 Aug 2011 07:14 PM |
grim, ik that. I don't want it to do that. I want it to show everyone like on the leaderboard. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 07:14 PM |
This should work:
while true do wait(1) local children = game.Players:GetChildren() for i = 1, #children do script.Parent.Text = script.Parent.Text .. " " .. children[i].Name end end |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 12 Aug 2011 07:17 PM |
here: while true do wait() pls = game:GetService("Players"):GetChildren() for i=1, #pls do script.Parent.Text = pls[i].Name wait(10) end end |
|
|
| Report Abuse |
|
|
bluehead
|
  |
| Joined: 12 Aug 2007 |
| Total Posts: 158 |
|
|
| 12 Aug 2011 07:25 PM |
| wil, it needs to show everyone at once. |
|
|
| Report Abuse |
|
|
bluehead
|
  |
| Joined: 12 Aug 2007 |
| Total Posts: 158 |
|
|
| 12 Aug 2011 07:26 PM |
| pie, that does the same thing as mine. |
|
|
| Report Abuse |
|
|
bluehead
|
  |
| Joined: 12 Aug 2007 |
| Total Posts: 158 |
|
| |
|
|
| 12 Aug 2011 07:30 PM |
| Did you test it with more than 1 person? |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 12 Aug 2011 07:33 PM |
Well, if it doesn't work entirely, when why not try a table?
words = {} while wait() do w = game.Players:GetChildren() for i = 1,#w do table.insert(words,i,w[i].Name) wait(.1) end script.Parent.Text = words end
I really never used tables and messages, but hey.. Worth a shot, no? |
|
|
| Report Abuse |
|
|
bluehead
|
  |
| Joined: 12 Aug 2007 |
| Total Posts: 158 |
|
|
| 12 Aug 2011 07:40 PM |
pie, yes i did. guy above me i have no clue how to use tables. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 12 Aug 2011 07:41 PM |
Have you tried it, at least?
If it did not work, have you looked at the output and considered pasting it for me? |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 13 Aug 2011 11:55 AM |
here: text = "Players: " while true do wait() pls = game:GetService("Players"):GetChildren() for i=1, #pls do text = text.. "" ..pls[i].Name.. ", " end script.Parent.Text = text end |
|
|
| Report Abuse |
|
|