Hi, Im trying to make a screen button where if you press it, the current gui becomes invisible and a different one becomes visible. Here is my script. The "mainMenu" gui becomes invisible, but the "WorldSelector" does not become visible.
Button = script.Parent mainMenu = script.Parent.Parent WorldSelector = game.StarterGui.WorldSelector.Frame Button.MouseButton1Click:Connect(function() WorldSelector.Visible = true mainMenu.Visible = false print("Button Pressed") end)
You're changing the visibility of the WorldSelector GUI that's in StarterGui, not in the LocalPlayer's PlayerGui.
local player = game.Players.LocalPlayer local button = script.Parent local mainMenu = button.Parent local worldSelector = player.PlayerGui.WorldSelector.Frame button.MouseButton1Click:Connect(function() worldSelector.Visible = true mainMenu.Visible = false print("Button Pressed") end)
Changing the visibility of the WorldSelector frame that's in StarterGui won't do anything to the GUI that's in the player's PlayerGui, because StarterGui is just where you put GUIs that you want to be cloned into each player's PlayerGui. The GUIs that each player sees is in their own PlayerGui.