It's a script that simply makes a decal visible/invisible on a brick with a ClickDetector. However, it activates using both left click and right click. How do I make it activate using only the left mouse click?
local isOn = true
function on()
isOn = true
script.Parent.Decal.Transparency = 0
end
function off()
isOn = false
script.Parent.Decal.Transparency = 1
end
function onClicked()
if isOn == true then off() else on() end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
on()
I've tried using [script.Parent.ClickDetector.MouseButton1Click:connect(onClicked)] for line 19 but then the script doesn't work at all.

1 comment
MouseButton1Click did not work because it's only usable on GUI's. From what I found. MouseClick, MouseHoverEnter, and MouseHoverLeave seemed to be the only action events you could use with a ClickDetector. There might be a way though that I'm not aware of.