Properties say Frame is not Visible yet it is Visible?

Code if anyone cares:

-- Version_0.0.1.0eBt
-- Designed and programmed by NSG, Lead Programmer, MFD™ Copyright 2015-2020. All rights reserved.
local selfDIR			= game:GetService("StarterGui"):waitForChild("MainUI")
local buttonDIR 		= script.Parent.Parent.Padding.ButtonPadding
local Play 				= buttonDIR:waitForChild("Play")
local Inventory 		= buttonDIR:waitForChild("Inventory")
local Shop 				= buttonDIR:waitForChild("Shop")
local Settings		    = buttonDIR:waitForChild("Settings")

Play.MouseButton1Click:connect(function()
	selfDIR.Menu.Visible = false
end)

UI and Properties:


Tree:
image


P.S. Buttons folder just contains the LocalScript above.
P.P.S. When button is clicked, the game registers the Event
Any help with this issue or Any other requirements, reply.

1 Like

It’s probably still visible on the server side meanwhile it’s not visible on a client-side?

As @ArticGamerTV said that means that you are only editing the visibility on the Client. As the client cannot directly affect the server anything done on a local script will only affect the client which is why when you check the properties on the server it shows it as not visible. If you want it to show as visible you would have to use a Remote event or handle the UI via a regular script rather than a local script (not recommended though)

You’re making the menu in StarterGui visible. That change won’t show. Player Guis aren’t rendered from here, you need to make the copy of the MainUI in the Player’s PlayerGui invisible.

@ArticGamerTV @topdog_alpha @colbert2677


It is for client side, it’s a menu

I know. Please read my message again. You should not be working with elements from StarterGui because that’s not where PlayerGuis are rendered from. Clients will not see changes made to StarterGui, hence why the property says it’s not visible but why you still actually see the Gui.

local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui
local MainUI = PlayerGui:WaitForChild("MainUI")

MainUI.Visible = false

This code sample above will actually hide the Gui. Working with Guis must be done from a player’s PlayerGui container, not StarterGui.

2 Likes

It used to be StarterGui, 30 chars

I’m not sure what you mean by that. Do you mean to say that StarterGui used to be the place where player Guis were rendered? No, it never has been. It always has been a container solely to determine what Guis should be given to the player upon respawning.

2 Likes

@colbert2677
This is what I mean:
Take a notice to the game.StarterGui.GuiFrame parts:

--[[ MAIN MENU BUTTONS ]] --[[ CopButtonClicked ]] 
script.Parent.Main.Buttons.CopButton.MouseButton1Click:Connect(
    function()
        script.Parent.Main.Visible = false
        local Player1 = game.Players.LocalPlayer.Name
        local SP1 = game.Workspace.SpawnLocation
        game.Lighting.Blrry.Size = 0
        game:GetService('StarterGui'):setCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
        game.Players.LocalPlayer.Team = game.Teams.Cops
        game.StarterGui.Gui.Return.Visible = true
        game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(SP1.Position)
        print(Player1, 'is cop')
        game.Workspace.Camera.CameraType = Enum.CameraType.Follow
        game.StarterGui.Gui.Frame.Visible = true
        for i = 1, 50 do
            wait(.1)
            game.StarterGui.GuiFrame.BackgroundTransparency = i / 25
            game:GetService('RunService').Stepped:Wait()
        end
    end
)