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

Simple MouseButton1Click not working?

Asked by 4 years ago

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!

0
is this a localscript? in that case localscripts cannot run in the workspace. Elixcore 1337 — 4y
0
Oh ok, so would you have any advice on how to make it work? TheEggsquidzidBoi 38 — 4y
0
Put it somewhere in the client, for example the StarterGui. Nickuhhhhhhhhhhhhhhh 834 — 4y
0
Oh got it! Thanks! TheEggsquidzidBoi 38 — 4y

1 answer

Log in to vote
0
Answered by
iivSnooxy 248 Moderation Voter
4 years ago
Edited 4 years ago

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)
Ad

Answer this question