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: Help with Changing GUI's of ALL Players

Previous Thread :: Next Thread 
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
18 May 2013 02:02 PM
So I need to be able to change the properties of a GUI that all players have to where the GUI effect takes place across everyone's screen.

However in the code I used, it only does the changes for ONE player. If I use game.Players:GetPlayers(), it does the first one Alphabetically listed. If I used game.Players:GetChildren() it does the first one to join the server. (found after testing)

Below is the function I used to getplayers, and tag their GUI so I could manipulate it later. Any help on what I did wrong would be awesome.

function getplayers()
for _, plyrs in pairs(game.Players:GetPlayers()) do
if plyrs.PlayerGui then
checkforgui = plyrs.PlayerGui.Reactor:FindFirstChild("Text")
end
end
end
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
18 May 2013 02:13 PM
game.Players.PlayerAdded:connect(function(player)
if player.PlayerGui then
checkforgui = player.PlayerGui.Reactor:findFirstChild("Text")
-- do stuff here
end
end)
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
18 May 2013 02:14 PM
I'm not all too familiar with other styles of coding, but the way I'd do this, it seems like you're trying to change a textlabel in everyone's GUI at the same time. What you should do is rename it to Message so it's not confused with a property (also called Text) and try the following:

players = game:GetPlayers()

function globalMsg(text)
for i, v in pairs(players) do
if v.PlayerGui:findFirstChild("Reactor") then
v.Message.Text = text
wait()
else
print("Reactor Gui not found for: " ..v.Name)
end
end
end

Report Abuse
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
18 May 2013 02:31 PM
@Geo, your method works as expected in Studio, but flops in the actual game.
Report Abuse
jacob24068 is not online. jacob24068
Joined: 04 Apr 2011
Total Posts: 646
18 May 2013 02:41 PM
players = game:GetService("Players")
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
18 May 2013 02:44 PM
^ What he said, sorry about that mistag, should fix my thingy
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