Frame Not Appearing

local button = script.Parent

local function onButtonActivated()
	print("Settings")
	game.StarterGui.Menu.Settings.Visible = true
end

button.Activated:Connect(onButtonActivated)

So, basically, this script makes a GUI appear when you click a GUITextButton. Now, it works perfectly. It prints the message, and sets the frame to Visible, but for some odd reason the frame STILL doesn’t appear. Its position is correct, it is set to Visible, and it’s parent is enabled, yet it still doesn’t actually appear.

1 Like

What is the button , like a part or something?

1 Like

No, it’s a GUITextButton. I have a main menu, in which there are a few buttons. When you click a button, another GUI appears. I’m having trouble with the appearing part. It says it’s visible, but it’s not there.

1 Like

Umm u can try

button.MouseButton1Click:Connect(onButtonActivated()
1 Like

It isn’t the actual script that’s the problem, at least from what I know. The GUI says it is visible, but it doesn’t actually display on the screen.

1 Like

What is the script under the button ? Script or local script?

Local script. This is because this main menu GUI is for a single player.

This is just a beginner mistake lol. You’re editing the GUI in StarterGui, which will not do anything. You need to change it from the player’s PlayerGui in order for it to work.

LocalScript in the Settings TextButton:

local button = script.Parent

local function onButtonActivated()
	print("Settings")
	script.Parent.Visible = true
end

button.Activated:Connect(onButtonActivated)
1 Like

Due to how my other scripts were written, I had to edit this a bit, but it did work. Thanks!