ClickDetectors and Mouse.Button1Down not firing

Hey there!

I was using ClickDetectors for a door in my game.
While I was scripting the ClickDetector, I noticed an issue.
With this code, the ClickDetector would not print hi:

script.Parent.ClickDetector.MouseClick:Connect(function(player) print("hi") end)

Confused, I created a LocalScript to use MouseButton1Down instead.

local mouse = game.Players.LocalPlayer:GetMouse() mouse.Button1Down:Connect(function() local target = mouse.Target if target == script.Parent then print("hi") end)

This script won’t work either.
Any solutions? Thank you.

Mine works fine for me, are there any more things on your code?




Why would you put a localscript on a part when they only run on startergui and starterpack, etc…?

Don’t put local scripts in workspace or else they won’t work, try using StarterPack or StarterGui