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

How do you get it to where you can click text buttons in Surface GUis?

Asked by
mnaj22 44
7 years ago

LOCAL SCRIPT

The scripts that go for Screen GUi's won't work on surface GUis for me. I have look around and tried to figure out the solution to this problem but I did not find one.

function onClick()

end

script.Parent.MouseButton1Click:connect(onClick)

I have things in the function but I don't think that could help find the solution but just in case...

click = 0
GUI = script.Parent

function onClick()
    if click == 0 then
        script.Parent.EntLev.Disabled = true
        script.Parent.Parent.SinDesc.Visible = false
        script.Parent.Parent.SinFrame.Visible = true
        GUI.Position = (UDim2.new(0, 20,0.2, 0))
        click = 1
    else
        script.Parent.EntLev.Disabled = false
        script.Parent.Parent.SinFrame.Visible = false
        GUI.Position = (UDim2.new(0, 10,0.2, 0))
        click = 0
    end
end

script.Parent.MouseButton1Click:connect(onClick)

So all I need to know is how do you make something happen when you click a text button in a surface GUi.

0
Is it a LocalScript? Because SurfaceGuis work almost identically to ScreenGuis, and can even be used in PlayerGui. User#6546 35 — 7y
0
@eLunate It is a LocalScript mnaj22 44 — 7y
0
That's why. LocalScripts don't work in Workspace. User#6546 35 — 7y

Answer this question