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

[SOLVED] How to fix 'Cases is not a valid member of PlayerGui?'

Asked by 7 years ago
Edited 7 years ago

I made a local script so once a button is clicked another gui would appear, but once I try to start a game I get the error from the output box: Cases is not a valid member of PlayerGui. Here is the script:

local player = game.Players.LocalPlayer
local open = script.Parent
local MainFrame = player.PlayerGui.Cases.Color.BuyFrame

open.MouseButton1Click:connect(function()
    if MainFrame.Visible == false then
        MainFrame.Visible = true
    end
end)

It says the error line is line 3. Any help would be appreciated!

0
Use WaitForChild abnotaddable 920 — 7y
0
Are you sure 'Cases' is in the player gui? Viking359 161 — 7y
0
Are you sure this is a local script? hiimgoodpack 2009 — 7y
0
@abnotaddable This method worked, thank you! possiblyInSync 1 — 7y

Answer this question