Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Only work when left click part, not both?

So, I know the normal function would look something like this script.Parent.ClickDetector.MouseClick:connect(onClick)

However, how would you make it so it would only work when you left click it, like that it works if you left or right click.

2 comments

0

Doesn't appear to be a way with ClickDetectors. Try Mouse.Button1Down or .Button2Down, you will have to identify if the player is clicking the part or not, LocalScript needed. http://wiki.roblox.com/index.php?title=API:Class/Mouse This is actually a good method as ClickDetectors do not work well in FilteringEnabled games (if at all).

1 answer

You could make to to where it says script.Parent.ClickDetector.MouseButton1:connect(onClick) (which is the left button and then script.Parent.ClickDetector.MouseButton2:connect(onClick) you should try that.

1 comment

0

MouseButton1 seems to only work with guis, but I'll give it a shot.

This discussion is preserved as it was. New answers, comments, and votes are closed.