I'm trying to make a left mouse detector on a clickdetector so you cant accidently right click it, and am using
local clickDetector = script.Parent
local buttonPressed = false
function OnClick(Clicker)
if not buttonPressed then
buttonPressed = true
local Mouse = Clicker:GetMouse()
print("gotMouse")
Mouse.Button1Down:connect(function()
print("Left Click")
end)
wait(0.2)
buttonPressed = false
end
end
clickDetector.MouseClick:connect(OnClick)
but I cant figure out how to make a :disconnect() work or anything. Please help

2 comments
I've tried that and it keeps telling me Disconnect is not a valid member of PlayerMouse
I figured it out thanks. I rearranged my code and it works thanks!