Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use a surface gui button?

Asked by 4 years ago

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

Log in to vote
0
Answered by
crueluu 169
4 years ago
Edited 4 years ago

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

Ad
Log in to vote
0
Answered by 4 years ago

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)
Log in to vote
0
Answered by 4 years ago

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

0
Where should I put it? koviddev 29 — 4y
0
Put it in the SurfaceGui's button. Also, put the button inside the frame. Should work after that. Brandon1881 721 — 4y
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 crueluu 169 — 4y

Answer this question