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

How can I get my GUI Script to detect clicking?

I have a LocalScript inside a GUI(In the StarterGui no less and the LocalScript is in a ScreenGui object), I'm trying to listen for a TextButton in a model being clicked. I'm trying to print something as a test but it doesent work. Why is this and how can I fix it? Any and all help is appreciated.

workspace.Prologue.ReWire.Screen.SurfaceGui.One.MouseButton1Click:connect(function()
	print("Button Pressed")
end)

1 answer

✓ Accepted answer

Use a text button for this and insert this in the text button.

local  Button = script.Parent
function Clicked()
	print("Button Pressed")
end
Button:MouseButton1Click:connect(Clicked)

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