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

MouseButton1Down Doesn't Work?

I am fairly new to scripting and I got this script from off of the ROBLOX wiki and I wanted to just see if it worked so I just made it print something. All the script does is when the player clicks the TextButton in the SurfaceGui it prints something to output but it doesn't do any of that...

local textButton = script.Parent

textButton.MouseButton1Down:connect(function()
	print("Clickity")
end)

2 answers

✓ Accepted answer

Make sure it's a localscript, and that the gui is in StarterGui

3 comments

0

The script is a local script, and the thing is the gui is a SurfaceGui it won't work in StarterGui.

0

Actually it's supposed to be in StarterGui. Even if it's a SurfaceGui.. as long as the Adornee is defined it will show up.

0

Hey cool thanks! I never thought about it that way.

Why don't you just add a ClickDetector and use that?

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