-- 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)
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.
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.
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.
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.