Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I use a surface gui button?

My current script is very simple for it:

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

The surfaceGui's button is the local scripts parent but it's not doing anything, anyone know how to make the code work? :) Thanks in advance.

3 answers

✓ Accepted answer

Place The Local Script In StarterGui Because Local Script Wont Work In game.Workspace so place it in StarterGui then refrence the button, Thats All You Need

I just tested it in roblox studio and it seems like you have to use a server script for that, not local.

3 comments

0

Where should I put it?

0

Put it in the SurfaceGui's button. Also, put the button inside the frame. Should work after that.

0

But That Would Show The Gui To Everyone In The Game I Thinks Its Better To Keep It In A Local Script But Move It To starter gui

put a local script into the button. put the frame into the parent of the button. in the localscript put

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

This discussion is preserved as it was. New answers, comments, and votes are closed.