A little help with UI's

Hello Dev Forum members!

Recently I’ve been wondering something that I couldn’t seem to find anywhere on the Developer Forum, and that’s how can I open a new Frame “Frame2” with a Text Button “Open” that’s already inside another Frame “Frame1”?

(Sorry if it’s in the wrong category)

Open.MouseButton1Click:Connect(function()
Frame2.Visible = true
end

You’ll have to define your Frames and Button aswell (assuming that they’re all in ScreenGui or have the same Parent)

local Button = script.Parent
local Frame2 = script.Parent.Parent:WaitForChild("Frame2")

Button.MouseButton1Click:Connect(function()
      Frame2.Visible = true
end)

Worked at first, after I tried a different Frame it just didn’t work.

Ok, it works now! Turns out I misspelled something.