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 » Scripters
Home Search
 

Re: Need help with updating everyone's gui :(

Previous Thread :: Next Thread 
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
11 Jan 2015 07:10 PM
I am at my wits end :(
Here is the Localscript that I use to update everyone's gui. When the player enters, the gui "start" is added from the replicatedstorage into everyone's playergui through another script. This Localscript is cloned into the Backpack and updates everyone's start gui + the start gui in the replicatedstorage for future players. The players are auto assigned to different teams in the beginning as well. What is not happening is that the first player does not get an updated version when the 2nd player enters but the 2nd player gets an updated version of the gui. I fear that the 2nd player will also not get an updated version of the gui when the 3rd player enters.
*"start" gui contains the Frame,"nameFrame",which contains, the 6 frames,"info1" to "info6". Each info contains a textlabel called name1 for frame1,name2 for frame2 and so on. The textlabel is suppose have a text of the player that has entered.
--I have spent hours on testing. Here are some that I tried:
1)copying a localscript into name1 to name6 which updates everyone's gui
2)Creating a gui with a text printing the text of name1 to name6 in the replicatedstorage which is suppose to be updated each time a player enters but only worked with the 1st player.

local allplayer = game.Players:GetChildren()
num = 0
local player = script.Parent.Parent

if script.Parent.Parent.TeamColor == BrickColor.new("Teal") then
for i,v in pairs(game.Players:GetChildren()) do
v.PlayerGui.start.nameFrame.info3.name3.Text = script.Parent.Parent.Character.Name
end
game.ReplicatedStorage.start.nameFrame.info3.name3.Text = script.Parent.Parent.Character.Name
elseif script.Parent.Parent.TeamColor == BrickColor.new("Bright Blue") then
for d,e in pairs(game.Players:GetChildren()) do
e.PlayerGui.start.nameFrame.info2.name2.Text = script.Parent.Parent.Character.Name
end
game.ReplicatedStorage.start.nameFrame.info2.name2.Text = script.Parent.Parent.Character.Name
elseif script.Parent.Parent.TeamColor == BrickColor.new("Bright red") then
for f,h in pairs(game.Players:GetChildren()) do
h.PlayerGui.start.nameFrame.info1.name1.Text = script.Parent.Parent.Character.Name
end
game.ReplicatedStorage.start.nameFrame.info1.name1.Text = script.Parent.Parent.Character.Name
elseif script.Parent.Parent.TeamColor == BrickColor.new("Bright yellow") then
for j,k in pairs(game.Players:GetChildren()) do
k.PlayerGui.start.nameFrame.info5.name5.Text = script.Parent.Parent.Character.Name
end
game.ReplicatedStorage.start.nameFrame.info5.name5.Text = script.Parent.Parent.Character.Name
elseif script.Parent.Parent.TeamColor == BrickColor.new("Bright viloet") then
for v,b in pairs(game.Players:GetChildren()) do
b.PlayerGui.start.nameFrame.info6.name6.Text = script.Parent.Parent.Character.Name
end
game.ReplicatedStorage.start.nameFrame.info6.name6.Text = script.Parent.Parent.Character.Name elseif script.Parent.Parent.TeamColor == BrickColor.new("Reddish brown") then
for n,m in pairs(game.Players:GetChildren()) do
m.PlayerGui.start.nameFrame.info4.name4.Text = script.Parent.Parent.Character.Name
end
game.ReplicatedStorage.start.nameFrame.info4.name4.Text = script.Parent.Parent.Character.Name
end
Report Abuse
bobser1234 is not online. bobser1234
Joined: 09 Mar 2012
Total Posts: 223
11 Jan 2015 07:33 PM
Are you remembering to destroy the current Gui in all Player Guis once there is a new player and then copy the new one over?
Report Abuse
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
11 Jan 2015 09:37 PM
I tried your method which is to remove the nameFrame from all the player in the game and replicating a new nameFrame into the "start" gui. However, the line of script below persistently fails to work.I don't see any mistake in this but it seems that Roblox is restricting me from accessing the PlayerGui to remove the Frame. Glitch perhaps? I need help to bypass this problem...
btw this script is in a LocalScript placed inside the PlayerGui of the player that just entered.

for i,v in pairs(game.Players:GetChildren()) do
if v.PlayerGui:FindFirstChild("start") then
v.nameFrame:Destroy()
end
local new = game.ReplicatedStorage.start.nameFrame:clone()
new.Parent = v.PlayerGui:FindFirstChild("start")
end
Report Abuse
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
12 Jan 2015 01:55 AM
Bump
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
12 Jan 2015 01:58 AM
You cannot access other plauers' PlayerGui from a localScript
Report Abuse
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
12 Jan 2015 03:03 AM
How would I do it then?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
12 Jan 2015 03:21 AM
With a Server Script of course(:
Report Abuse
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
12 Jan 2015 03:34 AM
Oh, thanks for the tip! It works now :))
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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