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

How do i make On_Click() for GuiButtons?

Asked by
funzrey 58
10 years ago

So i try this in my guibutton

Button=game.StarterGui.Gui.PlayBtn
function On_click(Button)
    Button:remove()
end

But it dosent work, How do i do this?

1 answer

Log in to vote
2
Answered by 10 years ago

Button=game.StarterGui.Gui.PlayBtn script.Parent.MouseButton1Down:connect(function() Button:remove() end

^I'm sure thats it

1
oops, forgot to put it in a code block. put end on another line Shaydesilva 85 — 10y
0
Its ok. i know funzrey 58 — 10y
0
accept the answer when your done, so we both get a rep point ;) Shaydesilva 85 — 10y
0
Only One Flaw, it still appears so i added another line: Button.Visible=false funzrey 58 — 10y
0
uhoh dosnt work funzrey 58 — 10y
Ad

Answer this question