PlayerGui change on Server not replicating to Client

I have a frame in a ScreenGui that is in the PlayerGui folder. The frame’s visibility is set to false. When, in a server script, I set the frame’s visibility to true, the frame’s Visible property remains false on the client side.

ScreenGui.frame.Visible = true

If I first set the frame’s visible property to false, and then to true, then it does show up on the client’s side.

ScreenGui.frame.Visible = false
ScreenGui.frame.Visible = true

Why does this occur?

1 Like

Client changes typically don’t replicate to the server, so when you change the frame’s visibility on the client that change doesn’t replicate to the server.

1 Like

The script in which the code is located in runs on the server, not the client.

You must be referencing something incorrectly then, or attempting to print a property’s value before it has been set.

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

local function OnPlayerAdded(Player)
	local PlayerGui = Player:WaitForChild("PlayerGui")
	local ScreenGui = Instance.new("ScreenGui")
	ScreenGui.Enabled = false
	ScreenGui.Parent = PlayerGui
end

Players.PlayerAdded:Connect(OnPlayerAdded)

This correctly displays that the ScreenGui's ‘Enabled’ property is disabled on the client.

I reference the same thing, and don’t print anything. There are also no errors that pop up in the console.

Post the .rbxl/.rbxlx file here.

I just made a test file, and for some reason it works there, but not in my other place. It must be something different in my original place. Thanks for the help.