How do I enable this screen guy as well?

I’m trying to make a main menu were when you press play it opens up a different screen how do I get this to work?
Here’s the script

local M = ("Menu")


script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Parent.Enabled = false
	M.Enabled = true
end)

You can use instance:FindFirstChild(M) to find an object by name.

Like this?

local M = ("Menu")
Instance:FindFirstChild(M)

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Parent.Enabled = false
	M.Enabled = true
end)

No, you have to look for an instance to call :FindFirstChild (for example, script.Parent) on it, and you have to store what :FindFirstChild returns to access its properties

I don’t understand could you put it in code? Wait like 5 minutes let me update the post.

I’m not sure where the menu is but you just make a second statement just like this, in the same function:

It’s inside the play button. Look at the top again you’ll see it updated. It will hide the main menu screen fine what I need to show is the menu screen.

I assume script.Parent.Parent.Parent is the MainMenuGui. You don’t want to disable the whole ScreenGui because that’s gonna keep all of its descendants from being rendered.

Ideally you’d want to use a loop but this also works:

local screenGui = script:FindFirstAncestor('MainMenuGui')

script.Parent.MouseButton1Click:Connect(function()
    screenGui.CreditsBtn.Visible = false
    screenGui.PlayBtn.Visible = false
    screenGui.Title.Visible = false
    screenGui.Menu.Visible = true
end)
1 Like

Thanks idk how I didn’t see that before.

1 Like