|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 12 Jan 2015 03:21 AM |
| With a Server Script of course(: |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2015 03:34 AM |
| Oh, thanks for the tip! It works now :)) |
|
|
| Report Abuse |
|
|