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: How do I locate PlayerGui For All Players in a script

Previous Thread :: Next Thread 
Oaktin is not online. Oaktin
Joined: 01 Sep 2013
Total Posts: 119
09 Aug 2014 06:31 AM

I am new to scripting and I was wondering how to locate PlayerGui in a game. Here is an example of what I'm trying to say:

game.Players.

I have no idea what comes after Players but I think it is this: (I haven't tested this yet)

game.Players.AllPlayers.PlayerGui

Please Help Me. Thanks.

-Oaktin
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
09 Aug 2014 06:38 AM
Each Player "Object" is stored within the "Players" table, you could utilize one of the generic for loops to search through each player in the table, the ":GetChildren()" method returns the Players table.

An example would be, game.Players:GetChildren(),
Alternatively, you could use game.Players:GetPlayers()

For more information on using this with the generic for loop, here's an article link,
http://wiki.roblox.com/index.php?title=Generic_for
Report Abuse
Oaktin is not online. Oaktin
Joined: 01 Sep 2013
Total Posts: 119
09 Aug 2014 06:39 AM
You sir are a god, Let me try it out!
Report Abuse
BillTrollberg is not online. BillTrollberg
Joined: 14 Nov 2013
Total Posts: 768
09 Aug 2014 06:39 AM
game.Players:GetChildren().PlayerGui
Report Abuse
Oaktin is not online. Oaktin
Joined: 01 Sep 2013
Total Posts: 119
09 Aug 2014 06:43 AM
Thank you so much :)
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
09 Aug 2014 06:57 AM
"game.Players:GetChildren().PlayerGui"
LOL no

for k,v in pairs(game.Players:GetChildren()) do
local pgui=v:WaitForChild("PlayerGui")
pgui.ScreenGui.Frame.Visible=true
end
Report Abuse
BillTrollberg is not online. BillTrollberg
Joined: 14 Nov 2013
Total Posts: 768
09 Aug 2014 07:17 AM
Obvious joke wasn't obvious?
Report Abuse
Oaktin is not online. Oaktin
Joined: 01 Sep 2013
Total Posts: 119
09 Aug 2014 07:18 AM
I am new to scripting give me some slack lol
Report Abuse
BillTrollberg is not online. BillTrollberg
Joined: 14 Nov 2013
Total Posts: 768
09 Aug 2014 08:36 AM
I was making some light humor at how obviously bad idea that would be.

game.Players:GetChildren() returns a table of all the children in the Players.

you can use it like this:

a = game.Players:GetChildren()
for i,v in pairs (a) do
print(i.." = "..v)
end

and get every player and the order they joined. Since game.Players isn't ordered alphabetically, but instead by when they arrived in the game space.
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