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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 09 Aug 2014 06:39 AM |
| game.Players:GetChildren().PlayerGui |
|
|
| Report Abuse |
|
|
Oaktin
|
  |
| Joined: 01 Sep 2013 |
| Total Posts: 119 |
|
| |
|
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 |
|
|
|
| 09 Aug 2014 07:17 AM |
| Obvious joke wasn't obvious? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|