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

How do you make a button do something?

Like I want to script it.

EX: I pressed the "Play" button, and it deletes the message.

I know everything, but the ending part. (Last line) I want to know it.

1 answer

-- Make sure this is in the button
Gui = Script.Parent.Parent.Parent --LOCATE THE WHOLE GUI HERE
function OnClick()
	Gui.Visible = false
end
script.Parent.MouseButton1Click:connect(OnClick)

--OR
Gui = Script.Parent.Parent.Parent --LOCATE THE WHOLE GUI HERE
function close()
	Gui:destroy()
end
script.Parent.MouseButton1Down:connect(close)

--EITHER OF THEM WORK. YOU ONLY NEED 1. Make sure this is the button's child

2 comments

1

That was helpful.

0

Thanks. If you wish, could you please consider this as the Correct Answer if you think so?

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