Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
|
| 26 Jul 2014 02:10 PM |
| I want to edit a players GUI while the game is running with a script. Normaly the script would be IN the GUI but I don't want that because I could save the space of 49 scripts. The family tree type thing would go like Players.Joebob1337.PlayerGui.theGUI But I need to change them ALL, and I don't know how to do that. Is it Players.character.PlayerGui.theGUI ? Thanks for helping! c; |
|
|
| Report Abuse |
|
|
Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
| |
|
|
| 26 Jul 2014 02:15 PM |
Noobs constantly say:
PLAYERGUI!!!!!!
But that makes no sense.
I think it goes something like dis: game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel |
|
|
| Report Abuse |
|
|
Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
|
| 26 Jul 2014 02:19 PM |
LocalPlayer?!???!?! WHAT IS THAT!??!?!?!??!?! (O_O) \- ll-/ / \ |
|
|
| Report Abuse |
|
|
Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
| |
|
|
| 26 Jul 2014 02:22 PM |
lolzies
Try this instead:
playerz = game.Players:GetChildren()
for i,v in pairs(playerz) do v.PlayerGui.ScreenGui --PlayerGui = StarterGui Basically end
Use that, you can change it and stuFF. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2014 02:25 PM |
function ChangeAllGuis(func) for I,v in ipairs(game.Players:GetPlayers()) do func(v) end end
ChangeAllGuis(function(player) player.PlayerGui.ScreenGui:Destroy() end) |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2014 02:25 PM |
Let me explain what I did there. I grabbed all of the players and named it a variable.
playerz = game.Players:GetChildren()
Then, I wanted to do the same thing to all of them.
for i,v in pairs(playerz) do v.PlayerGui.ObjectiveBar.TextLabel.Text = "Hi" -- Look inside their playergui end |
|
|
| Report Abuse |
|
|
| |
|
Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
|
| 26 Jul 2014 02:40 PM |
| Getplayers()? on GetChilldren()? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Jul 2014 02:41 PM |
| No. he means use Game.Players:GetPlayers() |
|
|
| Report Abuse |
|
|
HuntHello
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
|
| 26 Jul 2014 02:42 PM |
| Both GetChildren and GetPlayers work in that case but GetPlayers is safer |
|
|
| Report Abuse |
|
|
Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
| |
|
Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
|
| 26 Jul 2014 02:48 PM |
| Wait would this work? Players:GetPlayers().PlayerGui.NotificationGiver.RoundStatusBar Or can I not put a "Players:GetPlayers()" thing and then more Blank.Blah.Yo stuff? Tanks c; |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2014 03:08 PM |
| GetPlayers() and GetChildren() return a table. Not every player in 1 value, as to be honest, that would make no sense... |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 26 Jul 2014 03:18 PM |
| LocalPlayer gets the player the LocalScript is running in. This must be in a LocalScript to work correctly. |
|
|
| Report Abuse |
|
|