Can't turn off GUI elements

i’m trying to make a title menu, but i can’t disable or make the gui elements invisible.

here’s the code:

function Start()
	
	game.Workspace.select:Play()
	game.StarterGui.ScreenGui.Start.Visible = false
	
end

script.Parent.MouseButton1Click:Connect(Start)

not sure if it’s a bug or not. the sound still plays

1 Like

The ScreenGUI that is actually on screen resides in the player’s PlayerGui, not StarterGui.

1 Like

Like what @Pokemoncraft5290 said, You are changing the StarterGui, but you will want to change the PlayerGui

We can modify your script so it will change the PlayerGui instead of the StarterGui

local player = game.Players.LocalPlayer -- get the player
function Start()
	
	game.Workspace.select:Play()
	player.PlayerGui.ScreenGui.Start.Visible = false -- change it to PlayerGui instead of StarterGui
	
end

script.Parent.MouseButton1Click:Connect(Start)

By the way, I would also advise naming your ScreenGui, incase you have multiple of them, it can get really confusing later on.

1 Like

The sound still plays because it is before the game.StarterGui.ScreenGui.Start.Visible = false, which means it will run before game.StarterGui.ScreenGui.Start.Visible = false line of code.

2 Likes