I was looking at some code that I wrote in the past, and it never occurred to me before that the button that it belongs to can be opened using either the left or right mouse button. Here's the code
function BarrierBreak()
game.Workspace.Barrier:Destroy()
game.Workspace.BarrierBreaker:Destroy()
end
script.Parent.ClickDetector.MouseClick:connect(BarrierBreak)
How can I make the button only run the function on a left click?

1 comment
I'm reasonably sure you would have to make your own 'clickdetector' using Mouse.Target and Mouse.Button1Down