Local script changes value of GUI (visibility) but doesn't replicate to client?

  1. What do you want to achieve? Keep it simple and clear!
    I want the local script to change and manipulate the gui instances in PlayerGui, but even though the client sees it in the output bar, I don’t see it.

  2. What is the issue? Include screenshots / videos if possible!
    So as the title says, I have a local script that does something like:

local screen_gui = script.Parent
local container = screen_gui:FindFirstChild("container")
container.frame.Visible = true
print(container.frame.Visible)

In the output, it prints “true” but I don’t see any changes, even when it’s inside PlayerGui (not startergui)

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried adding a “task.wait()” at the 1st line of the script, before all variables.
    I also dont know why script.Parent.Container.frame.Visible = true does the trick?
    Is there an issue with my variables? I have checked the paths already.
4 Likes

Avoid naming Instances after properties


Are you checking your PlayerGui and not the StarterGui?

2 Likes

Sorry, I meant container.frame.Visible it prints the bool “true” in the output

and yes, I checked my playerGui
image

4 Likes

just as @HugeCoolboy2007 said, the issue appends because you have set the name of an instance to a variable, to fix this you need to rename the container.frame.Visible ← instance into something with either a lowercase or just another name

3 Likes

sorry, as I replied to @HugeCoolboy2007 , it was a typo, and I printed it to see the value (bool) of the GUI’s visibility (which prints “true”)

3 Likes

is it also a typo because in the script I can see that it says:
Findfirstchild("container") but I think it should be FindFirstChild("Container") as I can see its name from the screenshot

1 Like

yeah, I wrote everything my hand (not copy and paste) so there’s some typos, thanks for pointing that out

still however, that wasn’t the part of my issue

1 Like

okay so as I understand you are trying to make a frame invisible right?
Well right away today you are going to learn something new, so the Visible value of a GuiInstance2d represents if its visible or not, settings frame.Visible = true would cause the frame to be visible, setting it to false like here:
frame.Visible = false would cause it to go invisible,
so here is your fix:
local screen_gui = script.Parent local container = screen_gui:WaitForChild("Container") container.frame.Visible = false print(container.frame.Visible)

I fixed the typos and added WaitForChild to prevent a nil variable which can be caused if the players client loads to slow

2 Likes

no, I’m trying to have the client replicate the changes.

in simple terms I did:

local frame = script.Parent.frame
frame.Visible = true
print(frame.Visible) --output what the localscript sees (should be "true")

my output:
true

but no gui appeared visible in my screen

1 Like

ohhhh I understand it now, there are many possible causes for that, therefore check if the Screengui where the frame is located in has its enabled value set to true, also check if you can even see the frame by setting its visibilty manually

1 Like

oh and also container.Visible must be set to true too

1 Like

yes, somehow it turns on and appears when i manually turn it on in studio, but scripts also turn it on but i dont see it.

It is also enabled.

after I manually turned it on:

could you send a screenshot of the instances inside the container frame?

1 Like

image

2 Likes

Okay I see, there is no instance named frame inside the Container frame, so here is the fix:
local frame = script.Parent.Container frame.Visible = true print(frame.Visible) --output what the localscript sees (should be "true")

The mistake you did was, you where trying to set a instance with the name of frame (which I cant see inside the screenshot) to visible, whilst it isnt even there, which is why nothing happens so you need to change it to Container instead of frame

1 Like

again, I have to tell you, it’s not if instances are missing or if something is miss named. In my examples, I merely wrote it to show you an example.

Here is the my real problem (a bit more code) but here. Please take a look, as I don’t think you understand my problem.


2 Likes

Is Container_Frame’s Visibility set to true or not? That could also cause the issue since all the Gui objects are inside that frame

3 Likes

hmm good idea, let me see. thanks for the suggestion!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.