Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Only work when left click part, not both?

Asked by
k1nq 30
7 years ago

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.

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). M39a9am3R 3210 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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.

0
MouseButton1 seems to only work with guis, but I'll give it a shot. k1nq 30 — 7y
Ad

Answer this question