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

GUI script can't find children to tell them to become Visible?

Asked by 3 years ago

A continuation of my problem from here.

I need my MakeVisible script from before (see link above) to make my GUI visible. It does make its parent GUI Visible, however, the Children of the GUI I also need to be visible aren't becoming so.

Here are the Children I need to make Visible (Close, Next, Previous, and Cover): https://i.imgur.com/ksLXqZh.png

Below is my MakeVisible script that should be making these Visible. This is being triggered via a RemoteEvent. If you want to see those scripts, see the link to my other problem above.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = ReplicatedStorage:WaitForChild("DinosaurBook")

local GUI = script.Parent

local cover = GUI.Cover

local closebutton = GUI.Close

local nextbutton = GUI.Next

local previousbutton = GUI.Previous

local function onNotifyPlayer()
    GUI.Visible == true
    cover.Visible == true
    closebutton.Visible == true
    nextbutton.Visible == true
    previousbutton.Visible == true
end)

remoteEvent.OnClientEvent:Connect(onNotifyPlayer)

I also tried a WaitForChild, however this didn't work.

Note that my PlayerGui is Enabled: https://i.imgur.com/Uimz9vV.png

And the Frame is Visible after the ClickDetector registers the click: https://i.imgur.com/dfa3xJ4.png

But the Close button (for example- Next, Previous, and Cover also do not become Visible) is not Visible: https://i.imgur.com/YzVDzWE.png

I imagine there's something wrong in my script that it can't find the GUI's Children, but it can find the GUI itself?

0
Don't know if I'm correct or not, is it because you have == not =? == is used for something like this "if gui.visible == true then gui.visible = false" ashstitchedmyface 7 — 3y
0
You're not, I've tried this before when a friend brought up the same concern. The amount of = don't appear to make any difference. ControlCoreAngel 37 — 3y
0
Unfortunately, you were wrong, he was right. You would get an error because you have "GUI.Visible == true" and so on, == should be used when checking stuff in a way. Use 1 '=' for each 16-20. Since you forcibly want the gui visible, you would use =, you aren't checking stuff. greatneil80 2647 — 3y
0
Hi, like I said before, I tried this before and it changes nothing! This is not my problem. ControlCoreAngel 37 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Tried doing this the long way and inserting individual scripts into Cover, Close, Next, and Previous that would make them Visible when the RemoteEvent fired, however this didn't work either.

Any help would be great.

Ad

Answer this question