You can write your topic however you want, but you need to answer these questions:
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.
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?
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.
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.
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?
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.
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)
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.
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