Make GUI Change Visible for New Joining Clients

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want the GUI changes I make to be visible when a new player joins.
  2. What is the issue? Include screenshots / videos if possible!
    I am able to make GUI changes visible to all users in-game (like textlabel text changes) but when a new client joins, the default text label text is there. How do I make it so that changes are visible when a new player joins?
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve used a getplayers loop for the playergui, messed with remotevents but cant find any solutions after researching and digging.

What is the best way to approach this, any help at all is appreciated. I just want GUI changes to be visible when a player joins even if the changes were made before a player joined.

1 Like

Make changes inside of the StarterGui through a server script.

1 Like

That doesn’t work otherwise I wouldn’t have the same issue. Thanks for the response though.

When I try to do game.StarterGui.screengui blah blah no changes are made.

FYI: You cant change GUI’s through serverside only client-side. I just need to figure out how to make client side changes be visible to new players aswell.

PlayerJoins → Grab new UI info from another client (assuming this UI simply displays data, as opposed to taking inputs)

P.S you can change a players gui through a server script using Player.PlayerGui.Blah.blahblah.Text = "hehe change from server" though it is not recommended.

So you have tried changing the text for all clients while changing the text in StarterGui at the same time?

Am I wrong or does roblox just not support startergui changes from a serverside script?

for i,v in pairs(game:GetService(“Players”):GetChildren()) do
v.PlayerGui:FindFirstChild(“ScreenGui”):FindFirstChild(“UnitsInGame”):FindFirstChild(“TextLabel”).Text = “TEST” – Locate your own text and also a change
end

Yes I use this, but when a new player joins these changes dont show for them.

That is something I cannot tell you as I do not know myself

Well you sorta told me to do it so idk

1 Like

I have an idea, do:

game.Players.PlayerAdded:Connect(function(player)
    for _, plr in pairs(game.Players:GetPlayers()) do
        if plr == player then continue end
        player.PlayerGui:FindFirstChild("ScreenGui"):FindFirstChild("UnitsInGame"):FindFirstChild("TextLabel").Text = plr.PlayerGui:FindFirstChild("ScreenGui"):FindFirstChild("UnitsInGame"):FindFirstChild("TextLabel").Text
    end
end)

Interesting suggestion, I will try this out for sure! Appreciate the response, ill let you know.

1 Like

As for that, well I figure it does but I’m not sure since I never had a use case to try it (and I’m on mobile so I can’t rn)

The script you wrote doesn’t seem to be working, regardless of the fact it makes logistical sense. I’m not getting any errors in the console so idk the problem

Not trying to be rude, but the “FYI” is completely false here. You can change GUI’s through server scripts just fine. The problem is that you change everything on the client, therefore making it harder to change the StarterGUI through a server script. Instead, I would have the server save what is needed to be changed on the GUI’s and have the client request that information on join.

1 Like

This is the correct solution although the for _, Player in ipairs(Players:GetPlayers() bit is unnecessary, the UI changes only need to be for the local player, each player’s own local script will handle their UI.

local Game = game
local Players = Game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

local function OnPlayerAdded(Player)
	--Perform whatever manipulations to the local player's UI as necessary.
end
1 Like

This doesnt make new players see the exact same GUI as older players in the server

Yes it does, as long as you’re performing the same UI manipulations for each client. I’ve used similar logic in custom leaderboards before.

Its doesnt work for me can you show me your leaderboard script?

is there an example to go about this? I’m trying to comprehend how i’d make the server save it.