Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GUI keeps disappears when rejoining?

Asked by
Phixl 11
6 years ago

When I spawn in my game , I get a GUI When I leave the game and rejoin the GUI is disappeared. You get the GUI by being on a certain team color.

game.Players.PlayerAdded:connect(function(plr)
    if plr.TeamColor == BrickColor.new("Bright red") then
        local gui = game.ReplicatedStorage.EditorGui
        gui.Parent = plr.PlayerGui;
    end
    end)

game.Players.PlayerAdded:connect(function(plr)
 plr.CharacterAdded:connect(function(char)
  wait()
  char.Parent = game:WaitForChild('Lighting')
  plr:WaitForChild("PlayerGui") .EditorGui.Enabled = true
 end)
end)

I need help to get it where it will always spawn GUI every new Player joined.

I

0
Isn't it easier to put it on starterGui and then copy it to local player's playergui? Why bother putting it on replicated storage? Sounds like more work for me or I may just be dumb. Axceed_Xlr 380 — 6y
0
line 3 should be game.ReplicatedStorage.EditorGui:Clone() User#19524 175 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
local gui = game.ReplicatedStorage.EditorGui:Clone()

Ad

Answer this question