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: Easy question

Previous Thread :: Next Thread 
Leg0brick is not online. 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 is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
26 Jul 2014 02:13 PM
b
Report Abuse
EPICJAKEISCOOL is not online. EPICJAKEISCOOL
Joined: 07 Feb 2013
Total Posts: 1756
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 is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
26 Jul 2014 02:19 PM
LocalPlayer?!???!?! WHAT IS THAT!??!?!?!??!?! (O_O)
\- ll-/
/ \
Report Abuse
Leg0brick is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
26 Jul 2014 02:21 PM
(O_O)
\- ll-/
/ \

Report Abuse
EPICJAKEISCOOL is not online. EPICJAKEISCOOL
Joined: 07 Feb 2013
Total Posts: 1756
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
EPICJAKEISCOOL is not online. EPICJAKEISCOOL
Joined: 07 Feb 2013
Total Posts: 1756
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
26 Jul 2014 02:37 PM
@EPIC

:GetPlayers()
Report Abuse
Leg0brick is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
26 Jul 2014 02:40 PM
Getplayers()? on GetChilldren()?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Jul 2014 02:41 PM
No. he means use Game.Players:GetPlayers()
Report Abuse
HuntHello is not online. 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 is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
26 Jul 2014 02:43 PM
Tanks! C;
Report Abuse
Leg0brick is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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
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