SurfaceGui TextButton MouseButton1Click No Response

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want a achieve a button on a SurfaceGui that sets visible on the parent frame to false and visibility on a second frame to true.

  2. What is the issue? The MouseButton1Click function doesn’t seem to function anymore? Removed all other scripts to make sure and put in a print, no print to devconsole.

  3. What solutions have you tried so far? I have tried to recode the button, no luck.

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
	script.Parent.Parent.OS.Visible = true
end)

Explorer View:
doorcontrol

1 Like

At OS in the script I have an error underline, although I have no errors in the devconsole from the script.

Even line 2 doesn’t run, even though it has no error underlines and should work perfectly.

Set SurfaceGui | Roblox Creator Documentation on the part and put the SurfaceGui elsewhere as StarterGui.

Thank you so much! For some reason it still wont show OS on button press, any idea why?

You should add one more .Parent to this line:

script.Parent.Parent.Parent.OS.Visible = true

Oh! Didn’t notice that, silly mistake, thanks!