For some reason click detectors won't work for me when testing on a server. It works fine in Play Solo but it won't do anything on a test server. Even if I use a ClickDetector I put in there before it still won't work on a server.
1 | local cd = Instance.new( "ClickDetector" , script.Parent) |
2 |
3 | cd.MouseClick:connect( function (player) |
4 | print (player.Name .. " Clicked me!" ) |
5 | end ) |
Even the example on the wiki doesn't work in a server...
Your script should be inside the click detector, and the click detector in the part so your script should be something like this:
1 | local cd = script.Parent |
2 |
3 | cd.MouseClick:connect( function () |
4 | --insert code here |
5 | end ) |
script.Parent.Clickdetector.MouseClick:conenct(function() print("Working") end)