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

Simple MouseButton1Click not working?

Apparently, this 3 line button click detector isn't working. Here's the code:

script.Parent.MouseButton1Click:Connect(function()
	print("Working")
end)

Note that the button is in game.Workspace.Part.SurfaceGui.Frame.Frame

Any help will be appreciated!

4 comments

0

is this a localscript? in that case localscripts cannot run in the workspace.

0

Oh ok, so would you have any advice on how to make it work?

0

Put it somewhere in the client, for example the StarterGui.

0

Oh got it! Thanks!

1 answer

Insert a ScreenGUI in StarterGuithen a TextButton in The ScreenGUI Then put this code in...

script.Parent.MouseButton1Click:Connect(function()
   print(“Yay the script is working now”)
   else
   print(“Awww man it’s not working”)
   end
end)

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