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: Why does this...

Previous Thread :: Next Thread 
bluehead is not online. 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
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
12 Aug 2011 07:11 PM
What do you want it to do?
Report Abuse
bluehead is not online. 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 is not online. 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 is not online. 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
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
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 is not online. 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 is not online. 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 is not online. 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 is not online. bluehead
Joined: 12 Aug 2007
Total Posts: 158
12 Aug 2011 07:29 PM
Bump?
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
12 Aug 2011 07:30 PM
Did you test it with more than 1 person?
Report Abuse
grimm343 is not online. 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 is not online. 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 is not online. 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 is not online. 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
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