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

How do you detect mouse up ANYWHERE?

Asked by 6 years ago

I'm making a tool that does something when you start holding down the left mouse button, and stops when you release the button.. I have it so it stops if you switch windows, let go, start typing, or press esc, pretty much everything covered, except for 1 thing..

If you release the mouse button over someone's name on the leaderboard, or some other gui button it doesn't detect the mouse up, any ideas how to get around this?

1 answer

Log in to vote
0
Answered by
royee354 129
6 years ago

You will have to use user input instead of keydown and keyup events because that won't work everywhere, what will is the userinput script, this comes from the roblox wiki:


function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.R then print("R was pressed") end end
1
you forgot to add the event to the function ^^ User#20388 0 — 6y
Ad

Answer this question